Please provide the following:
- SDK Version: 36.0.0
- Platforms(Android/iOS/web/all): Android, iOS.
Hi, I have followed the push notifications guide and I have used both the Expo Push Notifications Tool as well as Postman to try and send notifications through.
- I have gotten the Push Token with (this works):
let token = await Notifications.getExpoPushTokenAsync();
after asking for permissions.
- I set up a listener and pass it a function which receives the notification as explained in the guide (I think this is broken):
_handleNotification = notification => {
this.setState({ notification: notification });
};
this._notificationSubscription = Notifications.addListener(this._handleNotification);
- I send a notification from Either Expo Push Notification Tool, or Postman with the correct headers.
After sending the notification, I tried getting the notification receipt.
{
"data": {
"status": "ok",
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
}
(x’s are just a placeholder here)
After all of this, I don’t get any notification on my physical phone (iPhone). I tried sending notifications when app was running in background, when app was running in foreground.
I have also tried setting the “iosDisplayInForeground” of “notification” in “app.json” toTRUE as suggested in the guide.
"notification": {
"iosDisplayInForeground": true
}
Please help.
Any pointers could be helpful. Thanks.