mattermost-mobile/app/mattermost_managed/mattermost-managed.android.js
enahum 0628cbc693 Upgrade to RN 0.48.3 (#911)
* Upgrade to RN 0.48.1

* Update deps to be exact

* Fix tests

* Remove unneeded code from setup and add socketcluster dep

* Fix drawer pan issue

* Fix bridge issues on iOS

* Upgrade to RN 0.48.3

* Search to use RN SectionList
2017-09-18 12:01:47 -04:00

37 lines
1.1 KiB
JavaScript

// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {BackHandler, NativeModules, DeviceEventEmitter} from 'react-native';
import LocalAuth from 'react-native-local-auth';
import JailMonkey from 'jail-monkey';
const {MattermostManaged} = NativeModules;
export default {
addEventListener: (name, callback) => {
DeviceEventEmitter.addListener(name, (config) => {
if (callback && typeof callback === 'function') {
callback(config);
}
});
},
clearListeners: () => true,
authenticate: LocalAuth.authenticate,
blurAppScreen: MattermostManaged.blurAppScreen,
getConfig: MattermostManaged.getConfig,
isDeviceSecure: async () => {
try {
return await LocalAuth.isDeviceSecure();
} catch (err) {
return false;
}
},
isTrustedDevice: () => {
if (__DEV__) { //eslint-disable-line no-undef
return true;
}
return JailMonkey.trustFall();
},
quitApp: BackHandler.exitApp
};