Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29743

onNotificationOpened works in Android emulator but not in actual device

$
0
0

I am using firebase notification module in my react-native application. It works perfectly in emulator but when I install the app in mobile, onNotificationOpened event listener never gets called when I open the notification. what am i missing ?

Environment

  • Development Operating System: Windows

Build Tools:

  • React Native version: 0.60.5
  • React Native Firebase Version: 5.5.6
  • Firebase Module: notifications

Code Snippet:

  this.notificationOpenedListener = firebase.notifications().onNotificationOpened((notificationOpen) => {
      Linking.openURL('https://www.google.com/');
  });

  /*
  * If your app is closed, you can check if it was opened by a notification being clicked / tapped / opened as follows:
  * */
  const notificationOpen = await firebase.notifications().getInitialNotification();
  if (notificationOpen) {
      Linking.openURL('https://www.google.com/');
  }

Viewing all articles
Browse latest Browse all 29743

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>