My application uses a freemium model, wherein free users can interact with the application locally without an account.
Currently data is stored in local files on-device.
I would like to migrate these local files to default Realm, and use Realm for persistence.
I would then like to offer the ability to backup & synchronize data for paying users of my application. However, this requires using “Sign in With Apple” in my case to authenticate them, and allow me to create a persistent, synced Realm.
However, a user can “Stop using Apple ID” with my application via Settings, which effectively signs them out. Alternatively, their subscription could lapse, in which case they should no longer be able to sync their data, and revert to local-only modifications.
This model is predicated on my ability to open a default Realm, operate within it, then convert it to a synced Realm, and at any point, stop syncing and revert back to a local-only Realm, much like the default Realm.
Is this possible? I’m trying to figure it out from the docs and from my own sample apps but I’m coming up short on conclusive answers.