Socket
Socket
Sign inDemoInstall

nativescript-vibrate

Package Overview
Dependencies
0
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.2 to 1.0.0

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc