Voip notifications are not receiving from Apns in debug mode in xamarin

836 Views Asked by At

I am working on a calling app where we are using pushkit notifications the problem is that I am not receiving notifications in debug mode with a Development profile. I am having the certificates installed and push notification certificates uploaded on App Identifier on the Apple account.

Whereas it is working in release mode. On the server-side, we are using APNs

3

There are 3 best solutions below

0
Siddhant maurya On BEST ANSWER

Making few minor corrections in APNS server-side code fixed the issue

request.Headers.Add("apns-id", Guid.NewGuid().ToString("D"));

request.Headers.Add("apns-push-type", "voip");

Hope this will help someone else facing this issue

1
ottermatic On

You need to have development listed in your entitlements.plist.

    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>aps-environment</key>
        <string>development</string>
    </dict>
    </plist>

You also need to make sure that your APNS settings have use Sandbox instead of Production. I can't remember the specific setting this applies too, but it's pretty easy to spot.

0
Bandi Tóth On

Also one more thing to check: PushKit token is not equals to the device's push notification token. Make sure when you send the VOIP notification, that you entered the PushKit token, instead the classic push notification token. Your VOIP token can be accessed by implementing IPKPushRegistryDelegate on your AppDelegate.cs