Identifying users

Learn how to identify users of your app using Adapty Flutter SDK. Identified users have access to subscriptions across all mobile platforms: iOS, Android

Adapty creates an internal profile id for an every user. However, if you have your auth system you should set your own CustomerUserId. You can find a user via CustomerUserId in Profiles, use it in a server-side API, it will be sent to all integrations.

Setting CustomerUserId

You can set your customerUserId at any time with Adapty.identify() method. The most common cases are after registration/auth, when a user switches from being an anonymous user to an authenticated user.

try {
    await Adapty.identify('<YOUR_USER_ID>');
} on AdaptyError catch (adaptyError) {}
} catch (e) {}

Logging out and logging in

You can logout the user anytime by calling .logout() method:

try {
    await Adapty.logout();
} on AdaptyError catch (adaptyError) {}
} catch (e) {}

You can then login the user using .identify() method.


Did this page help you?