Skip to content

Instantly share code, notes, and snippets.

@Pinwheeler
Created June 11, 2019 20:53
Show Gist options
  • Save Pinwheeler/92a24ff1ae22ff5890b1c1dab79ce8f5 to your computer and use it in GitHub Desktop.
Save Pinwheeler/92a24ff1ae22ff5890b1c1dab79ce8f5 to your computer and use it in GitHub Desktop.
Startup
async start() {
this.AppState.addEventListener('change', this._genericStateChange.bind(this))
Linking.addEventListener('url', this.handleOpenURL.bind(this))
await this.updateApp() // async call out to CodePush that updates the app if necessary
const credentialsRepository = new CredentialsRepository()
let credentials = await credentialsRepository.initialize(Keychain)
if (!credentials) {
return Navigation.setRoot({root: this._loggedOutRoot()})
}
let initialURL = await Linking.getInitialURL()
if (initialURL) {
this.handleOpenURL({url: initialURL})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment