2015-03-17 20:42:44 +00:00
|
|
|
/**
|
2015-03-23 22:07:33 +00:00
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
*
|
2018-02-17 02:24:55 +00:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2015-03-17 20:42:44 +00:00
|
|
|
*
|
|
|
|
* @providesModule VibrationIOS
|
2015-03-24 16:26:16 +00:00
|
|
|
* @flow
|
2015-03-17 20:42:44 +00:00
|
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
|
2015-03-18 22:57:49 +00:00
|
|
|
var RCTVibration = require('NativeModules').Vibration;
|
|
|
|
|
2016-03-02 12:27:13 +00:00
|
|
|
var invariant = require('fbjs/lib/invariant');
|
2015-03-17 20:42:44 +00:00
|
|
|
|
|
|
|
/**
|
2016-03-03 12:08:10 +00:00
|
|
|
* NOTE: `VibrationIOS` is being deprecated. Use `Vibration` instead.
|
|
|
|
*
|
2015-03-17 20:42:44 +00:00
|
|
|
* 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 = {
|
2016-03-03 12:08:10 +00:00
|
|
|
/**
|
|
|
|
* @deprecated
|
|
|
|
*/
|
2015-03-17 20:42:44 +00:00
|
|
|
vibrate: function() {
|
|
|
|
invariant(
|
|
|
|
arguments[0] === undefined,
|
|
|
|
'Vibration patterns not supported.'
|
|
|
|
);
|
|
|
|
RCTVibration.vibrate();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = VibrationIOS;
|