API call flow when switching between anonymous and signed in users #531
Unanswered
apfelfabrik
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey everyone,
We're allowing users to open our app and sign in optionally at a later point in time. What seems to work well is the push notification device registration for anonymous users using a JWT-less API token when we initialize the SDK. Now it seems we're running into some race conditions when the user signs up/in. We need to unregister the anonymous user's device from push notifications, we need to initialize the SDK again with the JWT-based API token, and we need to register the device again for the now authenticated user.
What would be the correct or recommended order of react native SDK API calls to achieve this, including calls to
initialize
with the individual API keys?Please excuse if this is a well-documented case, I couldn't find anything on this in the docs even though I think this should be rather common practice considering user management in mobile apps.
Cheers,
Martin.
Beta Was this translation helpful? Give feedback.
All reactions