diff --git a/src/apis/BackAndroid/index.js b/src/apis/BackAndroid/index.js new file mode 100644 index 00000000..e5a97c65 --- /dev/null +++ b/src/apis/BackAndroid/index.js @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * web stub for BackAndroid.android.js + * + * @providesModule BackAndroid + */ + +'use strict'; + +function emptyFunction() {} + +const BackAndroid = { + exitApp: emptyFunction, + addEventListener() { + return { + remove: emptyFunction + }; + }, + removeEventListener: emptyFunction +}; + +module.exports = BackAndroid; diff --git a/src/index.js b/src/index.js index f8b12e96..60a371c9 100644 --- a/src/index.js +++ b/src/index.js @@ -9,6 +9,7 @@ import Animated from './apis/Animated'; import AppRegistry from './apis/AppRegistry'; import AppState from './apis/AppState'; import AsyncStorage from './apis/AsyncStorage'; +import BackAndroid from './apis/BackAndroid'; import Clipboard from './apis/Clipboard'; import Dimensions from './apis/Dimensions'; import Easing from 'animated/lib/Easing'; @@ -59,6 +60,7 @@ const ReactNative = { AppRegistry, AppState, AsyncStorage, + BackAndroid, Clipboard, Dimensions, Easing,