I'm able to get the new token-based push working (without using certificates) just fine with normal push notifications and using a simple node.js file for the backend.
But, I can't get it to work with VoIP push. I've tried just using the token derived from PushKit - creditials.token but I always get a 400 error.
I can't seem to find any info on this online. Just the mention from WWDC that token-based auth could also be used for VoIP push.
VoIP push is considered a high-priority notification and delivered to an app without delay. An app launches automatically when it receives a VoIP push, removing the requirement to keep the app running in the background.
Push tokens are generated by push service providers. Braze connects with push service providers like Firebase Cloud Messaging Service (FCMs) for Android and Apple Push Notification Service (APNs) for iOS, and those providers send unique device tokens that identify your app.
Push token (device token) - is a unique key for the app-device combination which is issued by the Apple or Google push notification gateways. It allows gateways and push notification providers to route messages and ensure the notification is delivered only to the unique app-device combination for which it is intended.
'The device token you provide to the server is analogous to a phone number; it contains information that enables APNs to locate the device on which your client app is installed. APNs also uses it to authenticate the routing of a notification. '
I used the description from http://gobiko.com/blog/token-based-authentication-http2-example-apns/ to send token-based push notifications with python.
It worked well with normal push notifications, but when I tried a voip token instead of my normal push token, I also got a 400 error code. In the error description it said {"reason":"TopicDisallowed"}. Here, I had set my bundle id as apns-topic. I could fix the error by appending .voip to the bundle id.
Note that the voip notifications are silent notifications. Further, if you want to send a complication, according to https://www.foraker.com/blog/pushing-data-to-apple-watch-complications-with-pushkit you should try to append your bundle id with .complication instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With