Skip to content

Need Help with the Raw message for AWS Pinpoint VoIP Push Notification

0

Hello,

I am able to send VoIP Push Notification using apple developer console and able to receive call for the same on mobile device.

While sending the same from AWS Pinpoint Console on an endpoint, I am unable to figure out what exact content I should send as Raw message so that I will receive the call for the same on mobile device. I did multiple trial and error attempts with the Raw message content but every time I just receive a push notification instead of a call.

Please find few such samples below -

Sample 1
{
	"APNSMessage": {
		"aps": {
			"alert": {
				"title": "Call Ringing",
				"body": "Someone is calling."
			},
			"content-available": 1,
			"mutable-content": 1,
			"sound": "sound_default_ring.mp3"
		},
		"apns-push-type": "voip",
		"eventType": "call",
		"calling": "on"
	}
}
Sample 2
{
	"APNSMessage": {
		"aps": {
			"content-available": 1,
			"mutable-content": 1,
			"sound": "sound_default_ring.mp3"
		},
		"apns-push-type": "voip",
		"eventType": "call",
		"calling": "on"
	}
}
Sample 3
{
    "APNSMessage": {
        "aps": {
            "alert": {
                "title":"Incoming Call",
                "body":"Someone is calling you"
            },
            "content-available":1,
            "sound":"sound_default_ring.mp3"
        },
        "apns-push-type":"voip",
        "apns-priority": 10,
        "apns-expiration": 0
    }
}

Can someone help me with sample Raw message content which I should send to receive a call instead of a notification or am I making some another mistake here?

I am quite sure that I configured the APNS Sandbox correctly since I am able to receive push notification.

Thank you in advance.

1 Answer
0

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:

  1. The "apns-push-type" should be set to "voip". This is crucial for identifying the notification as a VoIP call.

  2. The "apns-priority" should be set to 10 for immediate delivery.

  3. The "apns-expiration" can be set to 0 or a very short time frame, as VoIP notifications are time-sensitive.

  4. The "content-available" flag should be set to 1 to wake up your app in the background.

  5. 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

  • 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.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.