nativescript-vibrate
Advanced tools
Comparing version 0.1.2 to 1.0.0
{ | ||
"name": "nativescript-vibrate", | ||
"version": "0.1.2", | ||
"version": "1.0.0", | ||
"description": "A vibrate NativeScript module for Android and iOS", | ||
@@ -5,0 +5,0 @@ "main": "vibrate.js", |
@@ -33,2 +33,5 @@ # NativeScript Vibrate | ||
## Permissions | ||
### Android | ||
@@ -42,4 +45,30 @@ | ||
## Notes | ||
### iOS | ||
There is no API to vibrate for a specific amount of time, so it will vibrate for the default no matter what (the duration is ignored). | ||
There is no API to vibrate for a specific amount of time, so it will vibrate for the default no matter what (the duration is ignored). | ||
## Usage | ||
To use the vibrate module you must first `require()` it from your project's `node_modules` directory: | ||
```js | ||
var vibrator = require( "./node_modules/nativescript-vibrate/vibrate" ); | ||
``` | ||
After you have a reference to the module you can then call its `vibration(milliseconds)` methods. For example, the code below turns your device's flashlight on: | ||
```js | ||
// my-page.js | ||
var vibrator = require( "/path/to/node_modules/nativescript-vibrate/vibrate" ); | ||
vibrator.vibration(2000); | ||
``` | ||
A sample barebones project is included with the repo (does not include the nativescript platforms folder). To use perform the following: | ||
* Check out repo | ||
* Switch to the VibrateDemo folder on your command line | ||
* Add the platforms that you wish to use (tns platform add {android or ios}) | ||
* If you added Android as a platform add the appropriate permission to AndroidManifest.xml | ||
* You should now be able to run the sample as usual (tns run {android or ios}) |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
5012
1
72