I've an app which receives notifications and have been trying to build the badge count locally on the app.
Within the App Delegate on iOS, I have the following
int notifcount = Preferences.Get("notifcount", 0);
UIApplication.SharedApplication.ApplicationIconBadgeNumber = notifcount +1;
Preferences.Set("notifcount", notifcount + 1);
This is placed in the methods DidReceiveRemoteNotification & WillPresentNotification.
Everything seems to work fine in debug mode - I receive notifications and the badge increments. However, when I release the app on Test Flight the behaviour changes - some users report the badge working fine, some get the badge incrementing sometimes and some don't get it at all.
I know ideally the badge would be passed along with the payload (but the app doesn't have user accounts yet).
My question is there limitations to Xamarin Essentials Preferences that stop it being used this way or something within iOS that could be causing this behaviour?
Thanks!