|
| 1 | +--- |
| 2 | + |
| 3 | +title: Send APNS VOIP notifications with Azure Notification Hubs |
| 4 | +description: Learn how to send APNS VOIP notifications through Azure Notification Hubs (not officially supported). |
| 5 | +author: sethmanheim |
| 6 | +ms.author: sethm |
| 7 | +ms.date: 3/23/2020 |
| 8 | +ms.topic: how-to |
| 9 | +ms.service: notification-hubs |
| 10 | + |
| 11 | +# Optional fields. Don't forget to remove # if you need a field. |
| 12 | +# ms.custom: can-be-multiple-comma-separated |
| 13 | +# ms.reviewer: MSFT-alias-of-reviewer |
| 14 | +# manager: MSFT-alias-of-manager-or-PM-counterpart |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +# Use APNS VOIP through Notification Hubs (not officially supported) |
| 19 | + |
| 20 | +It is possible to use APNS VOIP notifications through Azure Notification Hubs; however, there is no official support for this scenario. |
| 21 | + |
| 22 | +## Considerations |
| 23 | + |
| 24 | +If you still choose to send APNS VOIP notifications through Notification Hubs, be aware of the following limitations: |
| 25 | + |
| 26 | +- Sending a VOIP notification requires the `apns-topic` header to be set to the application bundle ID + the `.voip` suffix. For example, for a sample app with the bundle ID `com.microsoft.nhubsample`, the `apns-topic` header should be set to `com.microsoft.nhubsample.voip.` |
| 27 | + |
| 28 | + This method doesn't work well with Azure Notification Hubs, because the app's bundle ID must be configured as part of the hub's APNS credentials, and the value cannot be changed. Also, Notification Hubs does not allow the value of the `apns-topic` header to be overridden at runtime. |
| 29 | + |
| 30 | + To send VOIP notifications, you must configure a separate notification hub with the `.voip` app bundle ID. |
| 31 | + |
| 32 | +- Sending a VOIP notification requires the `apns-push-type` header to be set to the value `voip`. |
| 33 | + |
| 34 | + To help customers with the transition to iOS 13, Notification Hubs attempts to infer the correct value for the `apns-push-type` header. The inference logic is intentionally simple, in an effort to avoid breaking standard notifications. Unfortunately, this method causes issues with VOIP notifications, because Apple treats VOIP notifications as a special case that does not follow the same rules as standard notifications. |
| 35 | + |
| 36 | + To send VOIP notifications, you must specify an explicit value for the `apns-push-type` header. |
| 37 | + |
| 38 | +- Notification Hubs limits APNS payloads to 4 KB, as documented by Apple. For VOIP notifications, Apple allows payloads up to 5 KB. Notification Hubs does not differentiate between standard and VOIP notifications; therefore, all notifications are limited to 4 KB. |
| 39 | + |
| 40 | + To send VOIP notifications, you must not exceed the 4-KB payload size limit. |
| 41 | + |
| 42 | +## Next steps |
| 43 | + |
| 44 | +For more information, see the following links: |
| 45 | + |
| 46 | +- [Documentation for `apns-topic` and `apns-push-type` headers and values, including the special cases for VOIP notifications](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns). |
| 47 | + |
| 48 | +- [Documentation for payload size limit](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification). |
| 49 | + |
| 50 | +- [Notification Hubs updates for iOS 13](push-notification-updates-ios-13.md#apns-push-type). |
0 commit comments