Share your User ID with Qonversion to manage user access on various devices and platforms.
User identification is essential for a mobile application with an in-app subscription. Each subscriber should have a User ID that identifies them within your app. With Qonversion, you can use different ways to identify your users within the app based on your requirements.
Qonversion creates a unique User ID each time an app is installed and opened for the first time. To use Qonversion User ID, call the userInfo method. You can use Qonversion User ID for third-party integrations or other purposes like matching data from webhook notifications to your server.
Copy
Qonversion.shared().userInfo { user, error in // use user?.qonversionId}
Use User ID for third-party Integrations to attribute events to existing users in other platforms. For managing user access across multiple devices or Apple and Google app stores, use User Identifiers.
User Identity allows cross-device & cross-platform user identification and access management.
Use the documentation below and the User Identity concept only if you want to manage user access across multiple devices or Apple, Google and Web platforms for users logged into their accounts within your apps.If you need to assign your user ID for analytical purposes, use the setProperty() method described above.
User identification is critical in building cross-platform apps where you want to manage user access based on payments across different platforms. This can be a complex task as users can log in and out of your application, use multiple devices, or reinstall the app. To provide flexible subscription infrastructure and consistent data, we have built a comprehensive solution using a combination of Qonversion IDs, your backend IDs, and the merging concept for users.Qonversion lets you identify your signed-in users and unlock premium access across multiple devices. Use the identify() method to link a user to your signed-in subscriber. Call this method every time you want to use User Identity. For example, when a user logs in. User Identity provides a convenient way of managing premium access of your existing subscribers, including the following cases:
A user reinstalls your app for any reason. Using the same User ID allows you to provide premium access linked to previously purchased products.
A user logs in on several devices. You can provide premium access based on a subscription purchased on one of his devices.
A user logs in on iOS and Android versions of your app. You can provide premium access based on a subscription purchased on one of the platforms.
When a user logs into his account, call identify().
Copy
Qonversion.shared().identify("your_custom_user_id")// or the following option, if you want to get notified about the result.Qonversion.shared().identify("your_custom_user_id") { user, error in // use user if necessary}
Always use unique user ID values. Otherwise, a user can get matched to another user’s premium status.
To check entitlements for identified users, you can call checkEntitlements(). You can check the details of setting up entitlements here.
Two anonymous users install the app using separate devices and subscribe without using theidentify() method. These users have not been linked to each other.
Example 4. Two different anonymous users log in & Log out.
Let’s consider the following user flow:
User A installs the app and subscribes for the product X.
User A logs into user_id_1 account.
User A purchases product Y. Now User A has both entitlements X and Y granted.
User B installs the app and logs in with user_id_1 credentials. Based on the User’s Identity details, he also can use the app considering entitlements X and Y are granted.
User A logs out using the logout() method, he still has entitlements granted based on both purchases he has made on the device.
User B logs out and loses all the entitlements. His anonymous account has no purchases associated with him, as no purchases were made on his device.
It is worth mentioning, in this case, User A and User B have different store accounts on their devices.
Example 5. Two accounts with two separate purchases.
Let’s consider the following user flow:
User A and User B install the app using separate devices.
User A and User B have different store accounts on their devices.
User A subscribes to product X
User B subscribes to product Y.
User A then logs in with the ID user_id_1 for the very first time. At this moment, this user ID is created and Entitlement X attaches to the user_id_1 User Identity.
User B logs in with the same ID user_id_1.
User B now has Entitlement X (based on the User Identity) on top of Entitlement Y.
User A logs out, he still has Entitlement X (based on the device purchases).
User B logs out, he loses Entitlement X but still has Entitlement Y (based on the device purchases).
Anonymous ID
User ID
Action
A
null
Install
B
null
Install
A
null
Start Subscription X -> Gets Entitlement X
A
user_id_1 (login for the very first time)
identify(“user_id_1”)
B
null
Start Subscription Y -> Gets Entitlement Y
B
user_id_1
identify(“user_id_1”) -> Gets Entitlement X and Keeps Entitlement Y
A
null
Log out -> Keeps having Entitlement X
B
null
Log out -> Loses Entitlement X but still has Entitlement Y
User A installs the app on his iOS device and subscribes for the product X.
User A logs into user_id_1 account. Now Identity user user_id_1 has Entitlement X
User A' installs the app on his Android device and logs into user_id_1 account. Now User A' can get access to the Entitlement X - based content on his Android device.
User B takes User A’s iOS device and logs him out from the app.
User B logs into user_id_2 account and restores subscription. Now Identity user user_id_1 stops having Entitlement X, as it has been transferred to Identity user user_id_2
User A being logged in his Android device with user_id_1 account stops having access to the Entitlement X - based content. Now only Identity user user_id_2 is entitled to it.
Anonymous ID
User ID
Action
A
null
iOS device install
A
null
Start Subscription X -> Gets Entitlement X
A
user_id_1
identify(“user_id_1”)
A’
null
Android device install
A’
user_id_1
identify(“user_id_1”) -> Gets Entitlement X for Android device
B
null
iOS device log out
B
user_id_2
identify(“user_id_2”)
B
user_id_2
Subscription Restore -> Transfers Entitlement X to user_id_2 from user_id_1