Handle Push Notification

Hi, thank you for your effort on documenting the amazing Expo.
Base on the passage below:

   //Handle notifications that are received or selected while the app
    //is open. If the app was closed and then opened by tapping the
    // notification (rather than just tapping the app icon to open it),
    // this function will fire on the next tick after the app starts
    // with the notification data.

What does “will fire on the next tick” means, i ask it because:

I have implemented Notifications for both iOS and Android mostly with success but this._handleNotification is not fired when opening previously closed app by tapping notification.
It works perfectly when app is open (origin === ‘received’). I have tried everything i could based on my research and i cannot fire the handler when app is closed.

“sdkVersion”: “33.0.0”.

Please help me understand what to do.

Regards

Hey @gitteraz,

Are you handling when origin === 'selected'?

Cheers,
Adam

Hi, Thank you for replying.
Yes i am. But handler is only called when origin is received (while standalone app is open or expo client is open).

Regards

https://docs.expo.io/versions/v34.0.0/guides/push-notifications/#determining-origin-of-the-notification

So you’re app is closed and then you’re received a notification, tapping it which then opens the app and the listener is not firing with an origin value of selected?

The listener is not fired at all when opening app from the notification,

Interesting. Can you create a minimal, reproducible example of this and create a github issue that we can debug on our end?

Yes I can. Will do it.
Thank you

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.