react-native/Libraries/Vibration
zxcpoiu 2cfe774a56 Ios: complete iOS vibration pattern supports (js)
Summary:
This is a revised follow up version from #8574 ( originally implemented in `objc` )
This PR change the implementation in JS suggested by javache

**motivation**

To supports vibration pattern like android.

The [iOS vibration implementation link](http://stackoverflow.com/questions/12966467/are-there-apis-for-custom-vibrations-in-ios/13047464#13047464) mentioned by skv-headless at https://github.com/facebook/react-native/pull/6061#discussion_r54062592, which will not be accepted by apple since that implementation uses a private API. Thus, I use pure public API `NSTimer` to implement it.

**Note**

Since vibration time on iOS is not configurable, there are slightly differences with android.
for example:

**Android Usage:**
`Vibration.vibrate([0, 500, 200, 500])`
==> V(0.5s) --wait(0.2s)--> V(0.5s)

`Vibration.vibrate([300, 500, 200, 500])`
==> --wait(0.3s)--> V(0.5s) --wait(0.2s)--> V(0.5s)

**iOS Usage:**
if first argument is 0, it will not be included in pattern array.
( vibration
Closes https://github.com/facebook/react-native/pull/9233

Differential Revision: D3775085

Pulled By: javache

fbshipit-source-id: 370495857d5581399de32d2bed1ea1bcce193e9d
2016-08-25 18:28:38 -07:00
..
RCTVibration.xcodeproj Text highlighting on iOS 2015-07-24 08:41:58 -08:00
RCTVibration.h [ReactNative] Expanded license on obj-c files 2015-03-23 13:18:29 -08:00
RCTVibration.m [React Native] RCT_EXPORT lvl.2 2015-04-08 08:34:10 -08:00
Vibration.js Ios: complete iOS vibration pattern supports (js) 2016-08-25 18:28:38 -07:00
VibrationIOS.android.js Remove knowledge of fbjs from the packager 2016-03-02 04:28:38 -08:00
VibrationIOS.ios.js vibration module 2016-03-03 04:08:31 -08:00