question

mnsingh367 avatar image
mnsingh367 asked

Can I send Push notifications from Unity Editor to ios device ?

I'm trying to implement push notifications on ios devices and send notification from one player to challenge some other player for a battle. I can test this for android devices from within Unity Editor successfully.

I used PlayFabClientAPI.ExecuteCloudScript to send notification to a user and it worked on Android when I challenged a player (on Android) from within Unity Editor, I received a notification on android device as expected.

When I tried doing the same for IOS, I used PlayFabServerAPI.SendPushNotification and got success response when challenging from within Unity Editor to an ios device, but can't see a notification on the ios device. I've tried it multiple times and got success response as the other player is registered for APNS (which I can see from the player details in the playfab dashboard), but still no notification can be seen on the device.

Will I need to send notification from an other IOS device rather than Unity editor or I'm doing something wrong?


Note : When I test my app for push notification using Easy APN provider I receive notifications easily.

Also, I can't seem to find a method (function) that runs when a notification message arrives when my app is open. In Firebase, I have MessageReceived which I can use but for ios I don't understand what to do. @Brendan Please Help.

Push Notifications
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mnsingh367 avatar image
mnsingh367 answered

Sir, I've got it working after also registering my apns sandbox pem under notification settings. It did not work when I was only using the production pem. I'm now getting a callback in OnMessageReceived but custom data that I passed is missing. I'm using PlayFabServerAPI.SendPushNotification to send notifications over ios. Do you have an idea of what may be wrong?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Seth Du avatar image
Seth Du answered

Have you enabled push notification or network access in the capability of your app?

In terms of notification on-receive response issue, you may get get help from iOS developer community because it is out of our support scope.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.