-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find an alternative to VoIP push when building the app for iOS 13 #2714
Comments
One question relevant to VoIP push notifications, when I failed to report call kit manager that has stopped delivering even simple push notifications to my app. What shall I do to reset this? There must be some solution to this right? |
@VishalSharma91 you can reboot your device or delete the app. |
@ismailgulek Rebooted and re-installed the device. It doesn't even call didRegisterForRemoteNotificationsWithDeviceToken method. I think the CallKitManager malfunctioned push for this app. |
Yes, didRegisterForRemoteNotificationsWithDeviceToken never called, again |
Some problem. System are crashed my app after receiving push. |
Hi guys, |
Closed with #3268 |
|
We're testing this internally after #3268 on client side and matrix-org/sygnal#114 on server-side. Tracking issues with https://github.com/vector-im/riot-ios/milestone/33. Anyone can test the implementation with |
@ismailgulek we tried to test the implementation with xcode 11 branch and Sygnal v0.6.0
|
TL;DR: When we will build for iOS 13 SDK with Xcode 11 we should find an alternative to VoIP push to wake up the application when she is killed to render encrypted messages in notifications. We should try to use a Notification Service Extension to decrypt an encrypted message before it is displayed and see if it can work decently despite the 30 seconds limit of code execution.
About iOS 13 PushKit restriction
New restriction coming in iOS 13
Note: This restriction applies on iOS 13 only if we build the app for iOS 13 SDK with Xcode 11, we can continue to build the app with Xcode 10 for iOS 12 SDK to get some extra times.
##Several alternative options
APNS regular notification
Sending push notifications using only APNS is not an option as it would mean sending all messages unencrypted in push payload.
APNS silent push notification
We can send a silent push with APNS to wake up the app but as said in Apple documentation but there is following restrictions:
as pointed out here other restrictions:
This kind of notification is not reliable but we can use it to keep the app up to date. We can use it in conjunction with new iOS 13 BackgroundTasks framework to extend the duration of the sync treatment. But the main drawback is that the app should not be killed to make silent push working.
APNS notification using Notification Service Extension
A Notification Service app extension lets you customize the content of a remote notification before it is delivered to the user.
From this article we can find following restrictions:
With this option we can send a generic message in the notification like "Someone send you a message" and put the event id in the custom keys of the push content. And then try to render the final message from this event id within 30s otherwise it will display the generic message.
The main advantage of using Notification Service Extension is that this is possible to execute arbitrary code in background even if the main application is killed by the user.
Conclusion
VoIP push notifications using PushKit framework was an easy way to wake up the application to execute arbitrary code even when she was killed. But if Apple stay on it's position, an application built with iOS 13 will have to show a full-screen incoming call interface on a VoIP push. This makes impossible to silently execute code in the background using PushKit.
The most serious alternative is to use APNS notification with a Notification Service Extension. With this option we will be able to receive a notification even if the app is killed. But the drawback is that the user could end with a default title and message if the final message could not be rendered in time (within 30s).
The text was updated successfully, but these errors were encountered: