Fix app crashes on iOS 9.3 (#2005)

This commit is contained in:
SangJun Lee 2018-08-16 03:09:29 +09:00 committed by Elias Nahum
parent e44af0c26e
commit e1a62ee0de

View file

@ -2,7 +2,7 @@
// See LICENSE.txt for license information.
/* eslint-disable global-require*/
import {AsyncStorage, Linking, NativeModules} from 'react-native';
import {AsyncStorage, Linking, NativeModules, Platform} from 'react-native';
import {setGenericPassword, getGenericPassword, resetGenericPassword} from 'react-native-keychain';
import {loadMe} from 'mattermost-redux/actions/users';
@ -51,6 +51,14 @@ export default class App {
this.token = null;
this.url = null;
// Load polyfill for iOS 9
if (Platform.OS === 'ios') {
const majorVersionIOS = parseInt(Platform.Version, 10);
if (majorVersionIOS < 10) {
require('babel-polyfill');
}
}
// Usage deeplinking
Linking.addEventListener('url', this.handleDeepLink);