Files
react-native/website/versioned_docs/0.39/vibrationios.md
T
2017-10-27 11:51:58 -07:00

7.7 KiB
Raw Blame History

id, title, original_id
id title original_id
version-0.39-vibrationios vibrationios vibrationios

VibrationIOS #

NOTE: VibrationIOS is being deprecated. Use Vibration instead.

The Vibration API is exposed at VibrationIOS.vibrate(). On iOS, calling this function will trigger a one second vibration. The vibration is asynchronous so this method will return immediately.

There will be no effect on devices that do not support Vibration, eg. the iOS simulator.

Vibration patterns are currently unsupported.

Methods #

static vibrate(0) #

@deprecated

You can edit the content above on GitHub and send us a pull request!

Examples #

Edit on GitHub
'use strict';

var React = require('react'); var ReactNative = require('react-native'); var { StyleSheet, View, Text, TouchableHighlight, VibrationIOS } = ReactNative;

exports.framework = 'React'; exports.title = 'VibrationIOS'; exports.description = 'Vibration API for iOS'; exports.examples = [{ title: 'VibrationIOS.vibrate()', render() { return ( <TouchableHighlight style={styles.wrapper} onPress={() => VibrationIOS.vibrate()}> <View style={styles.button}> <Text>Vibrate</Text> </View> </TouchableHighlight> ); }, }];

var styles = StyleSheet.create({ wrapper: { borderRadius: 5, marginBottom: 5, }, button: { backgroundColor: '#eeeeee', padding: 10, }, });

Run this example

Run example in simulator
×

Powered by appetize.io