9

If I create an anonymous user on Realm Cloud in Swift like this:

let credentials = SyncCredentials.anonymous()

SyncUser.logIn(with: credentials, server: Constants.authURL) { user, error in
  //...
}

A user is created with a random Provider ID like 21483490cead296c6bc09ee40254d366 instead of an email address.

When the user decides later on to sign up for an account, is there a way to just update the provider ID to their email address and keep the same identity on their SyncUser record?

If not, how do I migrate their account? Do I have to manually migrate all their data to their new user account?

Clifton Labrum
  • 13,053
  • 9
  • 65
  • 128
  • Hi, have you found a way to do it? thank you – Apperside Jan 12 '19 at 15:56
  • Realm now supports anonymous login: https://docs.realm.io/sync/using-synced-realms/user-authentication – Clifton Labrum Jan 12 '19 at 16:16
  • Yes I saw it, but it does not explain anywhere how to transform an authenticated user into an authenticated one without creating one more user – Apperside Jan 13 '19 at 11:53
  • Did you ever find an answer to this question? I have been battling the same issue for a while now with no luck. – sellmeadog Mar 23 '19 at 14:39
  • I just asked realm support essentially the same question and there answer was "yes, you have to migrate". Not what we want, defeats the purpose of using realm for offline in the first place. Started a bounty for a clever way to accomplish the migration or skip it altogether – Brooks DuBois Jun 19 '19 at 20:41

0 Answers0