Push Notifications stop working until I refresh my Expo Push Token


#1

I’m getting some weird behaviour from Expo Push Notifications this morning on an Android 7 phone. It hasn’t been receiving any push notifications from my backend or the testing tool. Here’s what I’ve tried so far:

  1. Standalone app worked on Friday - over the weekend the app was closed - no notifications
  2. Opened app on the phone and tried to send notifications using the Expo testing tool - no notifications
  3. Restarted phone and opened app again (foreground and background) - no notifications
  4. Removed expo token I had and re-associated phone - notifications start working (but the token is the same)
  5. Close the app - still getting notifications

Do other people get this? I’ve seen questions about battery saving but I opened the app in the foreground and that didn’t fix it. For all calls I was getting a status: ok from the testing tool.


#2

Requesting the Expo push token will also request the underlying APNs device token. There is a chance your underlying device token changed – iOS periodically changes the device tokens automatically. Re-requesting shouldn’t be necessary (it should happen whenever the app launches) but doesn’t hurt.


#3

It’s unlikely the underlying token changed over the weekend but let’s assume that’s the cause here.

How do we detect something like this happening from our backend? Sending calls to the Expo API all returned an ok status and I don’t know how else to detect this?

Currently we are only requesting a token during the registration flow. Do we need to request this token with every app boot?


#4

Following up on this - we’re still getting issues with this handset that don’t seem to be related to the token refresh. What I’m seeing is some notifications aren’t getting through if the phone is left unused for a while and goes into ‘sleep’.

This seems to be limited to Samsung devices so far based on the handsets people have in the office.

Using the expo testing tool I’m sending notifications with an incrementing number so I can see which get through. If the phone is left to sleep for a few minutes the notification is unlikely to appear. If I wake the phone and send another notification, the second one appears but the first is lost. Both returned status: ok from the API.

In case it’s helpful, some test notification IDs (in order)

not seen: ac155014-1e35-4c3d-9d05-a5060705f0d9
seen: 0aa8085a-bc48-406d-b76b-573cc7ea828a
not seen: f2941d1e-fdc4-4795-9134-29d1e0cd0c01
seen: b4b8d724-9dfd-4330-9d4b-e87bb3840fed


closed #5

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