Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS: Deeplinking is not working when app is open #24

Open
mcalc001 opened this issue Aug 25, 2022 · 2 comments
Open

IOS: Deeplinking is not working when app is open #24

mcalc001 opened this issue Aug 25, 2022 · 2 comments

Comments

@mcalc001
Copy link

mcalc001 commented Aug 25, 2022

 const config = {
  initialRouteName: 'tabbar' 
  screens: {
    NewsArticle: {
      path: '/articles/news/:id',
    },
    VideoArticle: '/articles/video/:id',
  },
};

const linking: LinkingOptions<RootStackParamList> = {
  prefixes: ['myapp://'],

  async getInitialURL() {
    const initialUrl =
      (await Linking.getInitialURL()) || (await WonderPush.getInitialURL());
    return initialUrl;
  },

  subscribe(listener) {

    // Listen to incoming links from deep linking
    const linkingSubscription = Linking.addEventListener('url', ({ url }) => {
      listener(url);
    });

    return () => {
      // Clean up the event listeners
      linkingSubscription.remove();
    };
  },

  config: config,
};
    "react-native": "0.66.3",
    "react-native-wonderpush": "2",
    "react-native-wonderpush-fcm": "^1.0.6"

When the app is closed and a notification is received the deeplinking is working perfectly on IOS (it opens the app and navigates to the correct page). However when the app is open and receives a push notification the deeplink does not work.
This is not the case on android where it works perfectly.

Above is my deeplink config.

Thankyou you for your repose.

@mcalc001 mcalc001 changed the title IOS: Deep link when app is open IOS: Deeplinking is not working when app is open Aug 25, 2022
@LucasClaude
Copy link

LucasClaude commented Nov 10, 2022

@mcalc001 did you ever figure this out? thanks! Also do you have FireBase on your project? That seems to be the issue for me.

@huyvvbka
Copy link

I have the same problem, did you find any solution? @mcalc001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants