Flutter app losing local data when user closes the app - flutter

My app uses both shared_preferences and writing to a local json file (getting path using path_provider) for the data that it uses. I recently started testing it (starting 1/1/22) with a larger group and some people are having an issue where the data is lost when they close the app and reopen it. We're testing on both Android and iOS. The first user to have the issue was on iOS and has had it from the beginning. All the other users ran into the problem a couple of days ago (1/12/22) and is a mix of mostly iOS and 1 Android user.
The data persists while the app is running since it's consistent while the user navigates around. I haven't been able to replicate the problem myself and I haven't been able to find out what the issue in my research. Any thoughts of what may be going on?
I found a similar question that mentioned that path_provider provided different paths for storage, but that doesn't seem to be my issue here since the first piece of data that gets called is the shared_preferences data and that is also getting lost.

I did some troubleshooting and we figured out that the devices (mostly iOS) were deleting the data point from shared_preferences. I migrated that point of data to a json file and the issue disappeared. It does say in the documentation not to use shared_preferences for any critical piece of data and now I see why. It worked initially, but had issues later for a lot of people, so I'm probably not going to use it in the future.

Related

flutterfire_ui blocking iOS release

So months ago I was trying to upload my Flutter app to the App Store (it's already on Android) but kept getting rejected because when the Apple testers tried to sign in with Apple on their emulators, it gave an error message. It worked fine on all physical devices. I gave up trying but now I'm back at it and wonder if anyone knows if there is some sort of firebase_auth / flutterfire_ui version combo that happens to work in every situation (apple, google, email sign-in). I've tried the latest versions of each and the issues still exist. If I can't figure this out I will have to write my own sign-in page from scratch, which I would rather not do.
Sounds like a bunch of others are having the same issues. Has anyone experienced anything like this? Thanks!

Firebase Connection Killed

I have integrated Firebase into my iOS project. I have been using Firebase for years across many projects. This specifically is using the Firestore. I can authenticate fine and write to the database. However, after the write is complete, even though it's successful, I receive the following message:
Firebase Database connection was forcefully killed by the server. Will not attempt reconnect. Reason: Firebase error. Please ensure that you spelled the name of your Firebase correctly
The bundleID was copied and pasted directly from the app to the Firebase setup. I even deleted the app from Firebase and created it again. I have downloaded the GoogleService-Info.plist and I checked that the bundle there matches the bundle of the app. I can see nothing wrong here and again functionality is working fine.
The only instance I saw of this message browsing around was with a non-US based developer and it was suggested that additional config was required. However, that is not the situation for me. What else might cause this error to be generated?
The error message seems to point towards Realtime Database, despite your interest in Cloud Firestore.
I recommend:
Making sure you're using the latest SDK. Old SDK versions (before mid 2020) might require the Realtime Database URL to be present in the plist file, which isn't always the case anymore.
If step 1 doesn't solve the problem, you can:
Force the creation of a Realtime Database instance in the Firebase console.
Download the updated plist file and add it to your project.
If you end up with the second solution, can you comment with the SDK version you're using, so that I can check for issues in that?

App Store Downloading old version of app

I have a big problem. My app got accepted for an update. It downloads the old version even though it is showing the new screen shot of the new version. (No biggie, I have read that it sometimes does this.) But as soon as i download it on my iphone4, the store gives the little red badge showing an update is needed, which is for my app. I download the new update, It gives the first page's new graphics, but as soon as i try to do anything in the app, it crashes. But it downloads the correct version for my iPhone 5!! D: I have tested everything on both devices. And everything worked perfect. Thanks in advance!!!
Kurt
Wait a day. It should adjust. Otherwise email apple support. Most likely won't take more than a few hours
It can take a bit of time for the new version to propagate through all the various Apple store servers. If you try it now, you're very likely to get the new version in all cases of downloading from all locations and stores.

updating ans ios app is causing issues whereas reinstall works fine

i am experiencing a weird problem. last week i submitted updated app into App store and when it comes live i updated already installed app on my iPhone. i saw lots of issues on my home controller table view. after that i deleted and reinstall the app and it worked fine.
i found same behavior on some other test devices too.
i find it as a big issue because end user will never do reinstallation, he will always update the all and find these issues.
Any help will be highly appreciated.
This problem could be caused by incompatible models between those two versions. For example if you are caching your model objects it would be good practice to clear cache upon upgrade to avoid that problem.
Your application crashed due to update in core data model. Solution for this is you need to learn data migration of coredata. you can learn form here.
Hope you will get what i mean.

Core data problems on real device

I had a problem in my simulator - when I want to edit the table in core data or create a new table the program which was using the database fails every time I start it. So I google the problem and I found the solution - every time I want to change something in my tables I have to manually delete my database. So it works fine but nowadays I get the license for testing it on real device, but I do not know how will it works on real device. I work for company and maybe the database will be expanding with some new tables, and I really do not know how to prevent it in real device. I admit it is a strange problem, but can you help me?
If your change your Core Data model during testing, you can easily delete your app from the simulator/device. In this case Xcode will install a new database on your simulator/device when you re-install the app and your app won't crash.
If the app has already been released in iTunes and you want to change the database, you have to implement data migration in your app.
Hope I understood your question right. Please ask if you have any more questions.