Getting DeviceNotRegistered error

I’m trying to send a push notification to a device (my friend’s iPhone) that is running a standalone build of my expo app, but it’s telling me that ‘device isn’t registered’

If I run the my code on the expo app and console log the device id (I also post it to our servers) and send a post via http, I get a push notification from the expo app.

If I run the same exact code (minus the console log) on the standalone and get the device id from our servers, then send an http request, it throws me the error. Running the same code in the standalone to get my Expo push token ID on my personal device works. Notifications are enabled and I know that’s 100% true because it is posting an ID to the backend, but not one that works (again, for my friend’s phone). Any idea how to fix this?

Also, it has an underscore which I haven’t seen before, and the expo app one does not have an underscore: ExponentPushToken[xxxxxJFe-HA3_5EYmJQQJDw]

Underscores are fine and part of the valid character set. Did you friend give permission to the app to send notifications? You need to have permission to send notifications, and this is a common cause.

Yes, notifications were allowed:
A. we even switched it off, loaded the app, closed the app, switched them back on, loaded the app, restarted the phone and reloaded the app.
B: there was a value in our backend for the device id, and since I’m using the code provided by expo (if status !== granted, return) it wouldn’t have posted the device ID if it didn’t have permissions.

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