Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 #6061 (comment), 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 #9233 Differential Revision: D3775085 Pulled By: javache fbshipit-source-id: 370495857d5581399de32d2bed1ea1bcce193e9d
- Loading branch information
Showing
2 changed files
with
91 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters