jamesmontemagno / SettingsPlugin

Read and Write Settings Plugin for Xamarin and Windows
MIT License
324 stars 80 forks source link

Settings seem to be wiped ios #110

Closed kamelmojawaz1 closed 6 years ago

kamelmojawaz1 commented 6 years ago

So my app been published for more than a year now , and recently started to hear complainants from some iphone users that the app is kicking them out to the login page . What I do in my code is saving user ID in Settings.UID which is 0 by default , then it sets to user ID when they log in , and the only way to set it back to 0 if they log out . I do the following in App.OnStart() if (Settings.UID != 0) MainPage = new HomePage(); else MainPage = new LoginPage(); Pretty simply , and straightforward . No possible mistakes.

I started doing my research and found an old ios bug https://forums.developer.apple.com/message/207807#207807 https://forums.developer.apple.com/thread/44264 https://forums.developer.apple.com/message/45849#45849 https://forums.developer.apple.com/message/206691#206691 https://disqus.com/home/discussion/teamloom/how_we_fixed_the_ios7_forced_logout_bug_thats_been_plaguing_so_many_apps/ https://forums.developer.apple.com/message/205161#205161

briefly ios clears NSUserDefaults , and I know that this plugin saves directly to NSUserDefaults , so I was wondering if this happened to anybody before and if so any suggestions on how to solve it .

Thank you

jamesmontemagno commented 6 years ago

Not that I know of at all.

Reading the docs should be fine: https://developer.apple.com/documentation/foundation/nsuserdefaults https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/UserDefaults/AccessingPreferenceValues/AccessingPreferenceValues.html

https://stackoverflow.com/questions/1638766/do-nsuserdefaults-persist-through-an-update-to-an-app-in-the-appstore

JelleDamen commented 6 years ago

@kamelmojawaz1 I also started hearing this issue. But I've never had it on my test devices. Did you manage to find the source of the problem?