- Newest
- Most votes
- Most comments
To send a VoIP push notification using AWS Pinpoint that triggers a call on the mobile device instead of a regular push notification, you need to structure your raw message content correctly. Here's a sample of how your raw message content should look:
{ "aps": { "alert": { "title": "Incoming Call", "body": "Someone is calling you" }, "content-available": 1, "sound": "default" }, "apns-push-type": "voip", "apns-priority": 10, "apns-expiration": 0 }
A few key points to note:
-
The "apns-push-type" should be set to "voip". This is crucial for identifying the notification as a VoIP call.
-
The "apns-priority" should be set to 10 for immediate delivery.
-
The "apns-expiration" can be set to 0 or a very short time frame, as VoIP notifications are time-sensitive.
-
The "content-available" flag should be set to 1 to wake up your app in the background.
-
Include a "sound" key with a value of "default" or a custom sound file name.
When sending this through AWS Pinpoint, you'll need to wrap this JSON object in a RawContent object within an APNSMessage object. The structure would look like this:
{ "APNSMessage": { "RawContent": "{"aps":{"alert":{"title":"Incoming Call","body":"Someone is calling you"},"content-available":1,"sound":"default"},"apns-push-type":"voip","apns-priority":10,"apns-expiration":0}" } }
Make sure your app is properly set up to handle VoIP push notifications and that you're using the correct certificate (VoIP Services Certificate) in your AWS Pinpoint APNS channel configuration. If you're still having issues, double-check your app's implementation of PKPushRegistry and how it handles incoming VoIP push notifications.
Sources
Schema sample: RawContent object for a push notification - Amazon Pinpoint
Push Notification Template - Amazon Pinpoint
Sending a test push notification - Amazon Pinpoint
answered 2 years ago
Relevant content
asked 2 years ago

When I tried to send - { "APNSMessage":{ "RawContent":"{\n"aps":{\n "alert":{\n"title":"Hello",\n"subtitle":"Hello from Pinpoint!",\n"body":"Have a good day!"\n},\n"category":"Notification"\n},\n"customKey":"12345678"\n}\n" } }
Im receiving below error -
One of the message payloads that you provided isn't formatted properly.