Open tommyw1996 opened 1 month ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Description
Code
bool showNotification = Preferences.Get(UserPreferenceKeys.ShowNotification, true); bool showNotificationUsingDefault = Preferences.Default.Get(UserPreferenceKeys.ShowNotification, true);
Issue
Returns default value when executed whilst the application isn't open/running.
Scenario
My application is deployed via an ARM template and installed onto a local Android device via an APK file.
I'm currently trying to access some application preferences via a firebase messaging service using Firebase.Messaging.FirebaseMessagingService, specifically inside the OnMessageReceived method. I use these to determine if a notification should be shown or not. This method can be triggered in the background whilst the application isn't open/running, but when this happens, the preferences are returning the default values passed in, which in this case is true.
If I set my preference to false from inside of the application, when the application is reloaded, I can see that the preferences have persisted still and stored correctly.
Steps to Reproduce
Link to public reproduction project repository
No response
Version with bug
8.0.70 SR7
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
34
Did you find any workaround?
No response
Relevant log output
No response