apns-collapse-id not working? #129
-
I resend a push notification with same content and apns-collapse-id if Apple server is not responding before timeout. But sometimes the notification I resend is actually delivered successfully and then (unexpectedly) I ended up with duplicated notifications on user's device. I'm not sure if it's an iOS bug or APNSwift bug because when I delete one of the duplicated notification from iOS Notification Center, the another one with the same apns-collapse-id gets deleted as well, so iOS appears to recognized them as the same notification, but only when I deleting them. Has anyone experienced this issue? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I just tested it and it worked for me. This is 4 pushes, with two different collapse identifiers try await apns.send(notification, pushType: .alert, to: dt, collapseIdentifier: "1234")
try await apns.send(
notification, pushType: .alert, to: dt, expiration: expiry, priority: 10, collapseIdentifier: "1234")
try await apns.send(
notification, pushType: .alert, to: dt, expiration: expiry, priority: 10, collapseIdentifier: "12345")
/// Overriden environment
try await apnsProd.send(aps, to: dt, on: .sandbox, collapseIdentifier: "12345") |
Beta Was this translation helpful? Give feedback.
I just tested it and it worked for me. This is 4 pushes, with two different collapse identifiers