5

I am running sample application..... I am using this module for push notifications..... My problem is when clicking on push notifications after clearing the instance of the app...In onNotification() console is printed but the alert is not displayed.... even try to keep time out for the alert but it doesn't work..... this is a problem is getting for the only iOS....... Please give any suggestions.......

onNotification: notification => {
    console.log('NOTIFICATION:', notification)
        if(notification.notificationType === XXX){
         alert('NOTIFICATION:'+JSON.stringify(notification))
         }
   }
Vijay S
  • 282
  • 2
  • 7
  • 15
Harika
  • 1,081
  • 3
  • 14
  • 25
  • May be you forgot to add `notification.finish(PushNotificationIOS.FetchResult.NoData);` in the end of `onNotification`. https://facebook.github.io/react-native/docs/pushnotificationios.html#finish – tuan.tran Jun 11 '18 at 16:20
  • Hi, @TuấnTrầnDuy notification.finish(PushNotificationIOS.FetchResult.NoData); it's not working for me....... – Harika Jun 12 '18 at 04:31
  • I fixed it by adding a SetTimeout of 1000ms to the alert. Maybe the app isn't ready as fast as the alert... – Francis Jan 15 '19 at 02:08

0 Answers0