question

destinystudioss avatar image
destinystudioss asked

Client unregisters from iOS remote notification

Hello,

I am trying to implement remote notifications for my mobile game with Unity on iOS. I was able to register a player to ApplePushNotificationService. I use the "Send push notification" button in player menu, and it works if the game is on.

However, I get the following error after the game is closed.

"Failed to deliver to mobile device. Check that the device is registered for push notifications. Error: iOS Push Notification Failed: Client has been unregistered for push notifications.."

Is it an expected behavior that the client is unregistered from the remote notification service on application quit? Do you have any idea to keep the device registered when the application is closed?

Thanks

unity3dapplePush Notifications
1 comment
10 |1200

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

Rick Chen avatar image Rick Chen ♦ commented ·

Usually the iOS push notification won’t get unregistered automatically. Please check if you have called any API when you close the application.

0 Likes 0 ·

1 Answer

·
destinystudioss avatar image
destinystudioss answered

The issue was related to wrong certificate type selection, and it also depends on testing environment.

I was using "Sandbox & Production" certificate as I thought this one should cover both sandbox and production. However it does not work if you are testing your app via cable.

If you want to test your app via cable and run it directly from Xcode, you should use "Apple Push Notification service SSL (Sandbox)". If you want to test your app over TestFlight, you should use "Apple Push Notification service SSL (Sandbox & Production)".

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.