From e1a62ee0de8c3a8f3f7b5ef2c1bbc6f0dc9df87b Mon Sep 17 00:00:00 2001 From: SangJun Lee Date: Thu, 16 Aug 2018 03:09:29 +0900 Subject: [PATCH] Fix app crashes on iOS 9.3 (#2005) --- app/app.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/app.js b/app/app.js index 91818f1d9..a720c1bdb 100644 --- a/app/app.js +++ b/app/app.js @@ -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);