Push receipts never fail iOS

#1

Following the documentation for Expo Push Notifications, I’ve been storing the push tickets I receive in a database table for processing later. However, every time I hit this endpoint (https://exp.host/--/api/v2/push/getReceipts) to get the receipts, every receipt is Status: OK, even after I’ve gone into the app settings and revoked permission for sending push notifications. I’m trying to handle the case where a user grants permission for push notifications but revokes the permission later. Any idea what’s going on? I can’t seem to trigger DeviceNotRegistered or any other status than “OK”.

#2

Hey @haydenturek,

The iOS push receipt contains status: "ok" when Apple’s Push Notification service has successfully acknowledged the notification so using that value to check for permissions being revoked won’t work. After revoking, are you not receiving a notif as expected?

Cheers,

Adam

1 Like
#3

Correct: once I revoke the permission, the phone no longer receives push notifications, even when I send them. Does this mean my job is done? The reason I ask is because I’m using Amazon SNS, and if I have no way of knowing that the user revoked permission, then I therefor have no way of unsubscribing the device from related messaging topics. Can I trust that the messages won’t be delivered, and safely continue to send messages to the device when permission is revoked? Because that is what would happen in my scenario.

In essence, I was under the impression that I should store push tickets, and then process them later at some other time, fetching the receipts in order to unsubscribe devices that are no longer registered and handle other errors. Is this not the case?

#4

Hey @haydenturek ,

Did you ever figure out what was going on with this? I’m having the same issue now trying to test for “DeviceNotRegistered,” and no matter what I always get an “Ok” status from the receipt. I revoked permissions, and even uninstalled the expo app thinking that would make the token invalid, but it’s always “Ok”. Any direction would be greatly appreciated. Thanks!

#5

Nope,

I could never produce the scenario, so I just wrote code to handle the situation described in the documentation anyway, hoping for the best. The scenario still hasn’t occurred for me.

#6

Alright, I suppose I’ll have to do the same if I can’t produce it, which will probably be fine. Thanks for the reply! I’m going to do some more testing and I’ll update the thread if I find out anything.

Thanks!

closed #7

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