Recall a previous sent push-notification on iOS
Asked Answered
I

1

6

For a notification-app I need to recall messages previously sent via APNS in case those messages are outdated or read on another device - even if the app is not running.

As there is no "remove"-call via APN and also apps are not launched on remote notifications, I assume that the only possible way is to use PushKit and Voice over IP background mode. Since we don't use VOIP, the app might be rejected.

Another app telegram is capable of removing messages read on another device - even this app does not have VOIP support. So am I missing out somewhat or does telegram simply violates apple's guidelines?

regards

coyer

Instrumentalist answered 1/11, 2016 at 11:21 Comment(7)
Have you checked the new Mutable Notifications in iOS 10?Creamcups
Great stuff for iOS 10, I hoped there is something for iOS >= 8Instrumentalist
In that case you should look up apns-collapse-id. UPDATE: It seems you're out of luck, iOS 10 and above. I'm sorry.Creamcups
The standard approach is to use the push notification to display a local notification. Then she a message is read, send another push notification with that information. The app then cancels the local notification and it is removed. The stack exchange app does this for exampleRonel
Thx for the replies. @Lior I just started digging into telegram's code (after I noticed it's OpenSource). As I am not familiar with ObjC I haven't any glue yet. In telegram there's only push-notifications set and remote notifications and even when the app is not launched they can delete notifications even on iOS 9 (and older devices?)Instrumentalist
I assume that telegram will remove all notifications by simply setting badge to 0 for APNs (which will only work if previous messages had a badge > 0). So I will use iOS10 API, thx @LiorInstrumentalist
Its possible I believe; Check this SO Thread.Microscopium
I
3

I end up using VOIP-pushnotifications and create my own local notifications with UNNotificationRequest. I then have the opportunity to remove my outdated notifications at any time.

Apple indeed asks why I am using VOIP-push but accepted the app after I states that there is no other way removing outdated notifications.

Instrumentalist answered 11/9, 2017 at 12:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.