Difference between revisions of "Push notifications"

Jump to navigation Jump to search
905 bytes added ,  19:18, 4 February 2023
 
(2 intermediate revisions by the same user not shown)
Line 6: Line 6:
* VoIP pushes: MUST always make the device ring via CallKit
* VoIP pushes: MUST always make the device ring via CallKit
* Low priority pushes: can prevent display, but Apple may drop or arbitrarily delay them
* Low priority pushes: can prevent display, but Apple may drop or arbitrarily delay them
* High priority pushes: MUST show a notification unless being a chat app. Chat apps are granted an extra entitlement by Apple to suppress the notification.
* High priority pushes: MUST show a notification unless being a chat app. Chat apps are granted an extra entitlement by Apple to suppress the notification (this entitlement is available since iOS 13.3 released on December 10, 2019).
** citing the apple introduction on the "com.apple.developer.usernotifications.filtering" entitlement application page:
** citing the apple introduction on the "com.apple.developer.usernotifications.filtering" entitlement application page: <blockquote>This entitlement is intended for certain types of apps — such as messaging apps or location sharing apps — that use notification service extensions to receive push notifications without delivering notifications to the user.</blockquote>
**: <blockquote>This entitlement is intended for certain types of apps — such as messaging apps or location sharing apps — that use notification service extensions to receive push notifications without delivering notifications to the user.</blockquote>
** Apple documentation: https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_usernotifications_filtering?language=objc
** https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_usernotifications_filtering?language=objc
** Other popular messenger apps use this entitlement, too
** Other popular messenger apps use this entitlement, too
*** WhatsApp: https://www.reddit.com/r/TweakBounty/comments/z9oyf7/comment/iyirqor/?utm_source=reddit&utm_medium=web2x&context=3
*** Signal: https://github.com/signalapp/Signal-iOS/blob/main/SignalNSE/SignalNSE-AppStore.entitlements#L7
*** Threema: https://github.com/threema-ch/threema-ios/blob/main/ThreemaNotificationExtension/SupportingFiles/ThreemaForWorkRedNotificationExtension.entitlements#L7
*** Telegram: https://github.com/TelegramMessenger/Telegram-iOS/blob/master/build-system/fake-codesigning/profiles/NotificationService.mobileprovision (binary)
** Using this entitlement apps can even fetch/decrypt incoming call information and trigger a local "voip push"
** Using this entitlement apps can even fetch/decrypt incoming call information and trigger a local "voip push"
*** Apple documentation: https://developer.apple.com/documentation/callkit/cxprovider/3727263-reportnewincomingvoippushpayload?language=objc
*** Apple documentation: https://developer.apple.com/documentation/callkit/cxprovider/3727263-reportnewincomingvoippushpayload?language=objc
Line 35: Line 38:
To be clear: without that entitlement neither message retraction nor XEP-0333 read markers can be implemented!
To be clear: without that entitlement neither message retraction nor XEP-0333 read markers can be implemented!
And if an app has the entitlement: why bother delivering some stanzas out of band and running into the ordering problem if the app could as well connect to the xmpp server in the background and retrieve all pending stanzas in the right order?
And if an app has the entitlement: why bother delivering some stanzas out of band and running into the ordering problem if the app could as well connect to the xmpp server in the background and retrieve all pending stanzas in the right order?
Sidenote: Signal does exactly that: it uses push only to wake up the app and then fetches the messages using a dedicated network connection, like Monal does: https://github.com/signalapp/Signal-iOS/blob/main/SignalNSE/NotificationService.swift#L236
24

edits

Navigation menu