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

React-native: display foreground notifications like background notifications with zo0r/react-native-push-notification

$
0
0

I have set up push notifications on my React-native app with zo0r / react-native-push-notification . It works on Android, and on iOS when the app is in background mode.

However, the notification does not display when the app is in foreground mode with iOS. I'm aware that I have to handle the notification when in foreground mode but I'd like to display them exactly the same way there are displayed when in background mode.

So I did the following:

PushNotification.configure({
...
   onNotification: function(notification) {
      if (notification.foreground) {
         PushNotification.localNotification(notification);
      }
   },
...
}

But noting happens, the notification is still not displayed, what am I missing?


Viewing all articles
Browse latest Browse all 16750

Trending Articles



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