Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I think there is a bug #36

Closed
youngzm opened this issue Dec 3, 2017 · 7 comments
Closed

I think there is a bug #36

youngzm opened this issue Dec 3, 2017 · 7 comments

Comments

@youngzm
Copy link

youngzm commented Dec 3, 2017

If I uninstall the app or clear data,it will reset all buttons.But I don't want it happen,How can I do?

@jonfinerty
Copy link
Owner

Hi, Once persists all its data with sharedpreferences. So if the app is wiped or uninstalled that's gone too. At the moment this is working as intended as I didn't want to pollute the users phone with files that wouldn't get cleaned up. A future feature could be to have an option to store data outside this sandbox but then it might be tampered with by other apps or the user. In the meantime you'll need to either store this information server side (if you have one) or write it to a file yourself.

@Harti
Copy link

Harti commented Dec 20, 2017

Interestingly, after a clean reinstall, my app claims that Once.beenDone(Once.THIS_APP_INSTALL, "tutorial.skipped") is true, even if I clearDone it before uninstalling. Nowhere in my app am I setting markDone before the boolean is returned. Is there a good way to debug this?

@jonfinerty
Copy link
Owner

@Harti If you can write a failing test that would be amazing. Failing that you should be able to debug your app, set a breakpoint and then inspect the contents of the underlying collections in Once, theres an in-memory map that stores tags and when they were last seen. Behind that it's stored in sharedpreferences, I can't think of way that your sharedpreferences are surviving a clean reinstall, unless there's something unusual your doing?

@AntonHolovin
Copy link

@Harti maybe you have allowBackup=true in your AndroidManifest.xml?

@Harti
Copy link

Harti commented Jan 21, 2018

@AntonyGolovin yep, I do. Good catch! I'm assuming removing it will fix my issue (I'm unable to test it right now)?

@AntonHolovin
Copy link

Yes, allowBackup also preserves SharedPreferences.

@inmyth
Copy link

inmyth commented Nov 19, 2018

Is there a possibility of implementing some sort of XXX_RESET_BACKUP flag that resets the values restored from allowBackup ? I think app reinstall should give clean slate on guide, introduction status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants