Commit Graph

4 Commits

Author SHA1 Message Date
Ivan Ha e6ff0dacd5 fix and enrich Vibration docs
Summary:
The docs for [Vibration](https://facebook.github.io/react-native/docs/vibration.html) is broken and not informative now. Making people difficult to understand the usage without digging into the source code.

![screen shot 2017-08-23 at 12 44 50](https://user-images.githubusercontent.com/20895743/29599382-da4976b6-8801-11e7-96d2-b342f0bf36fb.jpg)

Tested the page locally.

![fireshot capture 4 - vibration - http___localhost_8079_react-native_docs_vibration html vibrate](https://user-images.githubusercontent.com/20895743/29599338-976816e0-8801-11e7-8f53-a228363353f3.png)
Closes https://github.com/facebook/react-native/pull/15614

Differential Revision: D5691254

Pulled By: hramos

fbshipit-source-id: b84f0d0f9c69bd0983fbc32424c521108640fdd4
2017-08-23 20:45:45 -07:00
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
Sokovikov e20e8a3cc8 Add support for vibration patterns
Summary:and "not supported" warnings for ios
Closes https://github.com/facebook/react-native/pull/6400

Differential Revision: D3113988

fb-gh-sync-id: 169623f157ec59c38b4368cbc668c85201b67ed8
fbshipit-source-id: 169623f157ec59c38b4368cbc668c85201b67ed8
2016-03-29 21:45:20 -07:00
Sokovikov 1bab7c5182 vibration module
Summary:I will fix other notes from https://github.com/facebook/react-native/pull/2794 if I get positive feedback.
Closes https://github.com/facebook/react-native/pull/6061

Reviewed By: nicklockwood

Differential Revision: D2982173

Pulled By: dmmiller

fb-gh-sync-id: d1e9407798b0293b090897a10996085b0f0c1b3e
shipit-source-id: d1e9407798b0293b090897a10996085b0f0c1b3e
2016-03-03 04:08:31 -08:00