{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/8574","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/8574/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/8574/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/8574/events","html_url":"https://github.com/facebook/react-native/pull/8574","id":163822872,"number":8574,"title":"Ios: complete iOS vibration pattern supports","user":{"login":"zxcpoiu","id":5081771,"avatar_url":"https://avatars.githubusercontent.com/u/5081771?v=3","gravatar_id":"","url":"https://api.github.com/users/zxcpoiu","html_url":"https://github.com/zxcpoiu","followers_url":"https://api.github.com/users/zxcpoiu/followers","following_url":"https://api.github.com/users/zxcpoiu/following{/other_user}","gists_url":"https://api.github.com/users/zxcpoiu/gists{/gist_id}","starred_url":"https://api.github.com/users/zxcpoiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zxcpoiu/subscriptions","organizations_url":"https://api.github.com/users/zxcpoiu/orgs","repos_url":"https://api.github.com/users/zxcpoiu/repos","events_url":"https://api.github.com/users/zxcpoiu/events{/privacy}","received_events_url":"https://api.github.com/users/zxcpoiu/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/react-native/labels/CLA%20Signed","name":"CLA Signed","color":"e7e7e7"},{"url":"https://api.github.com/repos/facebook/react-native/labels/GH%20Review:%20review-needed","name":"GH Review: review-needed","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-07-05T10:50:00Z","updated_at":"2016-07-25T12:31:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/8574","html_url":"https://github.com/facebook/react-native/pull/8574","diff_url":"https://github.com/facebook/react-native/pull/8574.diff","patch_url":"https://github.com/facebook/react-native/pull/8574.patch"},"body":"**motivation**\r\n\r\nTo supports vibration pattern like android.\r\n\r\nThe [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.\r\n\r\n**Note**\r\n\r\nSince vibration time on iOS is not configurable, there are slightly differences with android.\r\nfor example:\r\n\r\n**Android Usage:**\r\n`Vibration.vibrate([0, 500, 200, 500])`\r\n==> V(0.5s) --wait(0.2s)--> V(0.5s)\r\n\r\n`Vibration.vibrate([300, 500, 200, 500])`\r\n==> --wait(0.3s)--> V(0.5s) --wait(0.2s)--> V(0.5s)\r\n\r\n**iOS Usage:**\r\nif first argument is 0, it will not be included in pattern array.\r\n( vibration length on iOS is about 500ms )\r\n \r\n`Vibration.vibrate([0, 1000, 2000, 3000])`\r\n==> V(fixed) --wait(1s)--> V(fixed) --wait(2s)--> V(fixed) --wait(3s)--> V(fixed)\r\n\r\n`Vibration.vibrate([0, 1000, 2000, 3000], true)`\r\n==> V(fixed) --wait(1s)--> V(fixed) --wait(2s)--> V(fixed) --wait(3s)--> V(fixed) --wait(1s)--> V(fixed) --wait(2s)--> V(fixed) --wait(3s)--> V(fixed)\r\n\r\n`Vibration.vibrate([1000, 2000], true)`\r\n==> --wait(1s)--> V(fixed) --wait(2s)--> V(fixed) --wait(1s)--> V(fixed) --wait(2s)--> V(fixed)\r\n\r\n`Vibration.vibrate([0, 1000], true)`\r\n==> V(fixed) --wait(1s)--> V(fixed) --wait(1s)--> V(fixed) \r\n\r\n**Test plan (required)**\r\n\r\nI also added examples in `UIExplorer`.\r\nOpen `UIExplorer` on iOS, and plays it around.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/234940007","html_url":"https://github.com/facebook/react-native/pull/8574#issuecomment-234940007","issue_url":"https://api.github.com/repos/facebook/react-native/issues/8574","id":234940007,"user":{"login":"satya164","id":1174278,"avatar_url":"https://avatars.githubusercontent.com/u/1174278?v=3","gravatar_id":"","url":"https://api.github.com/users/satya164","html_url":"https://github.com/satya164","followers_url":"https://api.github.com/users/satya164/followers","following_url":"https://api.github.com/users/satya164/following{/other_user}","gists_url":"https://api.github.com/users/satya164/gists{/gist_id}","starred_url":"https://api.github.com/users/satya164/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/satya164/subscriptions","organizations_url":"https://api.github.com/users/satya164/orgs","repos_url":"https://api.github.com/users/satya164/repos","events_url":"https://api.github.com/users/satya164/events{/privacy}","received_events_url":"https://api.github.com/users/satya164/received_events","type":"User","site_admin":false},"created_at":"2016-07-25T12:31:30Z","updated_at":"2016-07-25T12:31:30Z","body":"cc @javache"}}
{"actor":{"display_login":"satya164"}}