Expo notifications - everything seems right, but not getting a notification popup

Please provide the following:

  1. SDK Version: 36.0.0
  2. 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.

  1. I have gotten the Push Token with (this works):
let token = await Notifications.getExpoPushTokenAsync();

after asking for permissions.

  1. 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);

  1. 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.

Did you turn on " Enable the Push Notifications Capability" in apple developer account? https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server

I have not integrated with apple dev account yet. I’m just using the Expo client app on my phone.

i think you can only get notifications on standalone app and not on expo client.

On the Expo website it states:

Note:

For Android, you’ll also need to upload your Firebase Cloud Messaging server key to Expo so that Expo can send notifications to your app. This step is necessary unless you are not creating your own APK and using just the Expo client app from Google Play.

which makes me think that the notifications should be working fine on the expo client.
I don’t know what I’m doing wrong.

Have a try without running your app. If you dont receive a pushnote on your device check if notifications are allowed on your iphone ( settings - notifications - expo).
You only need a listener in your app if you want to handle the pushnote in your app.
For me it works.

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