Skip to content

Instantly share code, notes, and snippets.

Created December 6, 2020 09:46
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Deep Linking Push Notifications with React Navigation #5
// App.tsx
// only new changes shown, refer:
const linking: LinkingOptions = {
prefixes: ['myapp://', ''],
config: deepLinksConf,
async getInitialURL() {
// Check if app was opened from a deep link
const url = await Linking.getInitialURL();
if (url != null) {
return url;
// Check if there is an initial firebase notification
const message = await messaging().getInitialNotification();
// Get deep link from data
// if this is undefined, the app will open the default/home page
return message?.data?.link;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment