For the complete documentation index, see llms.txt. This page is also available as Markdown.

How do I detect an existing native SDK connection?

Use the mobile SDK's getUserId function for the connection type to detect an existing native connection.

Use the mobile SDK's getUserId function for the connection type to detect an existing native connection. It returns the existing user_id if one is present.

With that user_id you can either:

  • Restore the record in your own database, or

  • Call the /auth/deauthenticateUser endpoint to properly disconnect.

Running this check at SDK initialisation handles the "already connected but metadata missing" case automatically.

The SDK uses the device's unique OS identifier to maintain the connection, so a reinstall on the same device should resolve to the same user_id unless the user was deauthenticated. (reference_id is your own mapping attribute and does not by itself re-attach a connection.)

If new user_ids appear on reinstall, upgrade to the latest SDK and store the user_id on your backend keyed by your own user identifier as a safeguard.

Last updated

Was this helpful?