Skip to content

Instantly share code, notes, and snippets.

@Pinwheeler
Created June 11, 2019 20:50
Show Gist options
  • Save Pinwheeler/3f3956625bee54c475bc8c12f182d8f0 to your computer and use it in GitHub Desktop.
Save Pinwheeler/3f3956625bee54c475bc8c12f182d8f0 to your computer and use it in GitHub Desktop.
handleOpenURL
async handleOpenURL(event) {
const route = UniversalRoutes.findLink(event.url, new APIClient())
if (this.AppState.currentState === 'active') {
let options = await route.navigationOptions()
Navigation.setStackRoot('CENTER_STACK', {component: options})
} else {
const f = nextState => {
// allows us to not have to hold on to route as state
this.AppState.removeEventListener('change', f)
return this._universalLinksStateChange(nextState, route)
}
this.AppState.addEventListener('change', f)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment