Closed metin-atalay closed 9 months ago
Print the description of the error instead of the localizedDescription, it might reveal something useful.
thank you for the reply, I will try and post it here.
I see the bug but I am confused. I register these devices and type firebase. How does it give such an error? Thank you for the advice.
deviceID : 0fae0a2a71bd432b6c2db1ed8cd838392bab1a6a16addcab1d77baeca18c7468
▿ APNSError
- responseStatus : 410
▿ apnsID : Optional<UUID>
▿ some : 9706DA1E-4A44-08A1-2FE6-753997CC5816
- uuid : "9706DA1E-4A44-08A1-2FE6-753997CC5816"
▿ reason : Optional<ErrorReason>
▿ some : ErrorReason
- _reason : APNSCore.APNSError.ErrorReason.Reason.unregistered
▿ timestamp : Optional<Date>
▿ some : 2024-01-20 08:05:45 +0000
- timeIntervalSinceReferenceDate : 727430745.8180001
That's a "normal" error result if the user has deleted or reinstalled the application. You should gracefully handle this error and not send messages to this APNS token in the future.
Although I don't understand what you mean by Firebase here, you don't seem to be using FCM?
I'm not currently using FSM, it would be good to switch to it. Actually, I used to work at a bank where I kept track of customers and their registered Device IDs, sending specific pushes. I had tried to create a similar structure. But, as you suggested, using FSM would be better. Thanks for your support. Vapor and @vzsg 💚
Personally don't think FCM is better. But I'm biased.
The given error
The operation could not be completed. (APNSCore.APNSError error 1.)
Usage
I register users in my application and send push notifications. I often encounter the error mentioned in the title. For example, I have 30 users, and when looping through them within a 'for' loop, I encounter an error while sending an APNS push notification to the 25th user. I haven't been able to resolve it yet.
To Reproduce
Expected behavior
Typically, one user is getting stuck; I am waiting for push notifications to be sent to all users
Environment