react-native-push-notification icon indicating copy to clipboard operation
react-native-push-notification copied to clipboard

onNotification does not trigge only in ios when app running background mode

Open vanhungoz opened this issue 8 years ago • 8 comments

react-native : 0.53.3 react-native-push-notification: 3.0.2 in my app, when app running in background mode. I have a remote notification, user tap it then my app was opened. but onNotification function was not trigged.

vanhungoz avatar May 24 '18 10:05 vanhungoz

+1

batuhanorhn avatar Jun 29 '18 13:06 batuhanorhn

+1

tatsna avatar Jul 11 '18 06:07 tatsna

PushNotification.configure in add;

onRegister: function (token) { console.log('TOKEN:', token);

     PushNotification.popInitialNotification(notification => {
          console.log(notification); 
      })
   },

batuhanorhn avatar Jul 12 '18 18:07 batuhanorhn

I think it's a dupplicate of #547. Feel free to reopen this if not.

Gp2mv3 avatar Jul 12 '18 18:07 Gp2mv3

React Native Push Notifications clearly states that we need to call configure outside of the React Native Lifecycle. This is very important.

https://product.farewell.io/visible-react-native-push-notifications-that-work-on-both-ios-and-android-5e90badb4a0f

https://prnt.sc/k61hz7

iamrutvik avatar Jul 13 '18 12:07 iamrutvik

@iamrutvik Brother, this way you can't trigger onNotification, see you reply a lot of posts, this is the answer, how do you do it?

Scpchao avatar Sep 07 '18 03:09 Scpchao

@Gp2mv3 The thread reference you posted discuss about issues on Android, I am facing this issue on iOS. In my case when the application is in a killed state, I receive notifications but when I tap on it the onNotification handler isn't called. Also I have kept the PushNotification.configure outside of the react native lifecycle, I tried everything recommended in several Github posts but without success. Any help would be highly appreciated.

nairabhijit avatar Jun 23 '19 17:06 nairabhijit

Any solutions to this? I spent a lot of time figuring out it

Vladislava9009 avatar Oct 19 '21 16:10 Vladislava9009