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()

@deprecated

Examples

'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,
  },
});
ToastAndroid.show()
  • References/JavaScript/React Native/APIs

static show(message, duration)

2025-01-10 15:47:30
Animated#getLayout()
  • References/JavaScript/React Native/APIs

getLayout() Converts {x, y} into {left, top} for use in style, e.g.

2025-01-10 15:47:30
CameraRoll.getPhotos()
  • References/JavaScript/React Native/APIs

static getPhotos(params) Returns a Promise with photo identifier objects

2025-01-10 15:47:30
AsyncStorage.mergeItem()
  • References/JavaScript/React Native/APIs

static mergeItem(key, value, callback?) Merges existing value with input

2025-01-10 15:47:30
Clipboard.getString()
  • References/JavaScript/React Native/APIs

static getString() Get content of string type, this method returns a Promise

2025-01-10 15:47:30
TimePickerAndroid.timeSetAction()
  • References/JavaScript/React Native/APIs

static timeSetAction() A time has been selected.

2025-01-10 15:47:30
StyleSheet#hairlineWidth
  • References/JavaScript/React Native/APIs

hairlineWidth: CallExpression This is defined as the width of a thin line on the platform. It can be used

2025-01-10 15:47:30
AppRegistry.getAppKeys()
  • References/JavaScript/React Native/APIs

static getAppKeys()

2025-01-10 15:47:30
AsyncStorage.setItem()
  • References/JavaScript/React Native/APIs

static setItem(key, value, callback?) Sets value for key

2025-01-10 15:47:30
CameraRoll.saveImageWithTag()
  • References/JavaScript/React Native/APIs

static saveImageWithTag(tag) Saves the image to the camera roll / gallery

2025-01-10 15:47:30