Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RCTVibration] Basic Vibration API #154

Closed
wants to merge 4 commits into from
Closed

[RCTVibration] Basic Vibration API #154

wants to merge 4 commits into from

Conversation

JoeStanton
Copy link
Contributor

  • Exposed as VibrationIOS.vibrate();
  • Included a UI Explorer example.
  • Vibration patterns are currently unsupported as there is no API to produce a vibration of less than 1 second on iOS.

@JoeStanton JoeStanton changed the title Add RCTVibration API [RCTVibration] Vibration API Mar 16, 2015
@JoeStanton JoeStanton changed the title [RCTVibration] Vibration API [RCTVibration] Basic Vibration API Mar 16, 2015
@@ -146,6 +146,11 @@ function setupGeolocation() {
GLOBAL.navigator.geolocation = require('Geolocation');
}

function setupVibration() {
GLOBAL.navigator = GLOBAL.navigator || {};
GLOBAL.navigator.vibrate = require('Vibration').vibrate;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it doesn't comply with the specification and we're going to want something different for Android. Do you mind making a VibrationIOS module?

@JoeStanton
Copy link
Contributor Author

@vjeux Fixed up according to your comments. Not 100% sure if I got the docs in the right place so let me know if not.

Also:
screen shot 2015-03-16 at 21 57 46

@@ -46,6 +46,7 @@ var EXAMPLES = [
require('./AdSupportIOSExample'),
require('./AppStateExample'),
require('./ActionSheetIOSExample'),
require('./VibrationExample'),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I should now call this IOS or if it's ok.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, call it IOS please. We're going to have a different one for Android with other options

* Exposed as navigator.vibrate();
* Include a UI Explorer example.
* Vibration patterns are currently unsupported as there is no API to produce a vibration of less than 1 second on iOS.
@vjeux
Copy link
Contributor

vjeux commented Mar 16, 2015

Looks good to me, i'll pull in internally and wait for the tests to see :)

@JoeStanton
Copy link
Contributor Author

👍 Great thanks for all the feedback.

@vjeux
Copy link
Contributor

vjeux commented Mar 16, 2015

Okay, can I ask you a favor? Can you remove the changes in extractDocs.js. We're not mirroring those internally, so they make the patch to fail and the entire tool breaks :x

We need to fix the tool but as a small workaround would be nice if you could help out :) Thanks

@JoeStanton
Copy link
Contributor Author

No probs! Done. Think the previous Travis build failed randomly as the xctool tests are running fine for me locally.

@vjeux
Copy link
Contributor

vjeux commented Mar 17, 2015

Yay, it passed and it's merged :) When I do the next update (this afternoon) it's going to go live. Thanks!

react-one pushed a commit to react-one/react-native that referenced this pull request Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants