2015-03-16 21:02:57 -07:00
|
|
|
/**
|
|
|
|
* Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* @providesModule VibrationIOS
|
|
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
|
2015-03-17 22:22:03 -07:00
|
|
|
var RCTVibration = require('NativeModules').Vibration;
|
|
|
|
|
2015-03-16 21:02:57 -07:00
|
|
|
var invariant = require('invariant');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
var VibrationIOS = {
|
|
|
|
vibrate: function() {
|
|
|
|
invariant(
|
|
|
|
arguments[0] === undefined,
|
|
|
|
'Vibration patterns not supported.'
|
|
|
|
);
|
|
|
|
RCTVibration.vibrate();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = VibrationIOS;
|