question

Jakub Smekal avatar image
Jakub Smekal asked

Re-registering push notifications

Hello,

recently we decided to take down our game from Google Play Store, and upload it back under new package name.

We are using the same PlayFab title as before, but push notifications work only for players with new PlayFab accounts.

Players who played our old game and come to the new one, recovering their account using Google/Facebook, get this error:

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

Is there any way to fix this?

Thank you

Push Notifications
2 comments
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 ♦ commented ·

May I ask is this error message from PlayFab API? Does this issue occur when using AndroidDevicePushNotificationRegistration API call or PlayFab login API call?

0 Likes 0 ·
Jakub Smekal avatar image Jakub Smekal Seth Du ♦ commented ·

This happens when trying to send notification from dashboard. But I found the problem - I'm getting the token from FirebaseMessaging only the first time I start the game, this means when I recover player account and I restart the game, I'm not getting the token anymore, so it doesn't register the notifications.

0 Likes 0 ·

1 Answer

·
Jakub Smekal avatar image
Jakub Smekal answered

Turns out this was caused by getting the FirebaseMessaging token only once so I changed the way of receiving the token

From:

FirebaseMessaging.TokenReceived += (sender, token) => { /*token.Token*/ };

To:

FirebaseMessaging.GetTokenAsync().ContinueWith(token => { /*token.Result*/ });
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.