I have downloaded my game from Google Play Console and installed it on my Samsung tablet with Android version 11. PlayFabClientAPI.AndroidDevicePushNotificationRegistrationAsync was executed and the Android device identifier was stored in the player's Title Data.
I use this code to get the Android device identifier:
if (Device.RuntimePlatform == Device.Android) deviceID = Android.Provider.Settings.Secure.GetString(Android.App.Application.Context.ContentResolver, Android.Provider.Settings.Secure.AndroidId);
The player's Title Data:
{"DeviceAndroid":"d680f159038cb73f","DeviceIos":""}
At this moment the push notifications worked.
After that, I uninstalled my game on the Samsung tablet and I installed Android version 12 on the device.
Then I downloaded and installed my game again on the device but AndroidDevicePushNotificationRegistrationAsync was not executed because the player already had the same device identifier stored in Title Data and therefore push notifications didn't worked.
I get this error message on Android when I use the Send push notification button in the title player account overview: 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.
I needed to delete the device identifier manually in the player's Title Data in order that AndroidDevicePushNotificationRegistrationAsync could be called again in my game. After that, push notifications worked again.
The player's new device identifier in Title Data is the same:
{"DeviceAndroid":"d680f159038cb73f","DeviceIos":""}
In my game I check if the player's device identifier is different than the device identifier stored in Title Data. If it is different, then I call AndroidDevicePushNotificationRegistrationAsync and I store the new device identifier in the player's Title Data. But in this case, the device identifier was always the same but push notifications didn't worked after updating Android version from 11 to 12.
How can I find out if I need to call AndroidDevicePushNotificationRegistrationAsync again after the player has updated his Android version?