Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jamesmontemagno/VibratePlugin
Vibrate Plugin for Windows and Xamarin
https://github.com/jamesmontemagno/VibratePlugin
Last synced: 30 days ago
JSON representation
Vibrate Plugin for Windows and Xamarin
- Host: GitHub
- URL: https://github.com/jamesmontemagno/VibratePlugin
- Owner: jamesmontemagno
- License: mit
- Archived: true
- Created: 2016-02-11T22:39:13.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-04-03T20:37:10.000Z (over 1 year ago)
- Last Synced: 2024-11-08T22:58:20.865Z (about 1 month ago)
- Language: C#
- Size: 1.54 MB
- Stars: 45
- Watchers: 7
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-xamarin-forms - Vibrate ★45
README
## Vibrate Plugin for Xamarin and Windows
Simple and elegant way to trigger the vibration on a device in your Xamarin.iOS, Xamarin.Android, Windows, and Xamarin.Forms projects.### Setup
* Available on NuGet: https://www.nuget.org/packages/Xam.Plugins.Vibrate [![NuGet](https://img.shields.io/nuget/v/Xam.Plugins.Vibrate.svg?label=NuGet)](https://www.nuget.org/packages/Xam.Plugins.Vibrate/)
* Install into your PCL project and Client projects.Build status: ![Build status](https://jamesmontemagno.visualstudio.com/_apis/public/build/definitions/6b79a378-ddd6-4e31-98ac-a12fcd68644c/12/badge)
### Migrate to: [Xamarin.Essentials](https://docs.microsoft.com/xamarin/essentials/index?WT.mc_id=friends-0000-jamont) or [.NET MAUI](https://learn.microsoft.com/dotnet/maui/platform-integration/?WT.mc_id=friends-0000-jamont)
I have been working on Plugins for Xamarin for a long time now. Through the years I have always wanted to create a single, optimized, and official package from the Xamarin team at Microsoft that could easily be consumed by any application. The time is now with [Xamarin.Essentials](https://docs.microsoft.com/xamarin/essentials/index?WT.mc_id=friends-0000-jamont), which offers over 50 cross-platform native APIs in a single optimized package. I worked on this new library with an amazing team of developers and I highly highly highly recommend you check it out.
Additionally, Xamarin.Essentials is now included in & [.NET MAUI](https://learn.microsoft.com/dotnet/maui/platform-integration/?WT.mc_id=friends-0000-jamont).
Due to the functionality being included "in the box" I have decided to officially archive this repo.
### Platform Support
|Platform|Version|
| ------------------- | :------------------: |
|Xamarin.iOS|iOS 7+|
|Xamarin.Android|API 10+|
|Windows 10 UWP|10+|### API Usage
To gain access to the Vibrate class simply use this method:
```csharp
var v = CrossVibrate.Current;
v.Vibration(TimeSpan.FromSeconds(1)); // 1 second vibration
```#### Methods
```csharp
///
/// Vibrate the phone for specified amount of time
///
/// Time to vibrate. 500ms is default
void Vibration(TimeSpan? vibrateSpan = null);
```#### Platform Tweaks
**iOS**
There is no API to vibrate for a specific amount of time, so it will vibrate for the default time the system specifies (around 500 milliseconds)..**Android**
The `android.permission.VIBRATE` permission will automatically be added for you into your AndroidManifest.xml#### Contributions
Contributions are welcome! If you find a bug please report it and if you want a feature please report it.If you want to contribute code please file an issue and create a branch off of the current dev branch and file a pull request.
#### License
Under MIT, see LICENSE file.