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

static vibrate() @deprecated

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

static cancelAllLocalNotifications() Cancels all scheduled localNotifications

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

static show(message, duration)

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

static getInitialURL(callback) If the app launch was triggered by an app

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

static parallel(animations, config?) Starts an array of animations all at

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

flattenOffset() Merges the offset value into the base value and resets the offset to zero. The final output

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

static create(obj) Creates a StyleSheet style reference from the given object

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

static vibrate(pattern, repeat)

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

static measure(callback) Determines the location on screen, width, and height

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

removeAllListeners()

2025-01-10 15:47:30