Qonversion

The Qonversion Inc. Developer Hub

Welcome to the Qonversion Inc. developer hub. You'll find comprehensive guides and documentation to help you start working with Qonversion Inc. as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

User Identifiers

Setting User ID and cross-platform User Identity to manage user access on multiple devices

User identity is an essential component of a mobile application with an in-app subscription. Each subscriber has a User ID that identifies them within your app. You can get an accurate subscriber's status using Qonversion and the correct User ID.

1. Qonversion User ID

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 launch method with completion. You can use Qonversion User ID for third-party integrations or other purposes like matching data from webhook notifications to your server.

Qonversion.launch(withKey: "projectKey") { (result, error) in
    // Use Qonversion User ID for your needs
    // result.uid
}
[Qonversion launchWithKey:@"projectKey" completion:^(QNLaunchResult * _Nonnull result, NSError * _Nullable error) {
  // Use Qonversion User ID for your needs
  // [result uid];
}];
Qonversion.launch(this, "projectKey", false,
        new QonversionLaunchCallback() {
        @Override
        public void onSuccess(@NotNull QLaunchResult launchResult) {
            // print launchResult.getUid()
        }

        @Override
        public void onError(@NotNull QonversionError error) {
        }
    }
);
Qonversion.launch(this.application, "projectKey", false, object : QonversionLaunchCallback {
    override fun onSuccess(launchResult: QLaunchResult) {
        // print launchResult.uid
    }

    override fun onError(error: QonversionError) {
    }
})
QLaunchResult _qLaunchResult = await Qonversion.launch(
      'projectKey',
      isObserveMode: false,
    );
// Use Qonversion User ID for your needs
// _qLaunchResult.uid;

2. User ID for third-party Integrations

Qonversion SDK provides an asynchronous method to set user ID for third-party integrations.

Qonversion.setUserID("yourSideUserId")
[Qonversion setUserID:@"yourSideUserId"];
Qonversion.setUserID("yourSideUserID");
Qonversion.setUserID("yourSideUserID")
Qonversion.setUserId('yourSideUserId');
Qonversion.setUserId('yourSideUserId');
Qonversion.SetUserID("yourSideUserId");

🚧

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.

3. User Identity

User Identity allows cross-device & cross-platform user identification and access management.

🚧

Use the documentation below and the User Identity concept only in case you need to manage user access across multiple devices or Apple and Google app stores for users that are logged into their accounts within your app.

In case you just need to assign your side user ID for analytical purposes use the Qonversion.setUserID() method described above.

User identification is critical in building cross-platform apps, where you need 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 allows you to 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 providing 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.

Logging in

Each time a user logs into his account, call identify().

Qonversion.identify("your_custom_user_id")
[Qonversion identify:@"your_custom_user_id"];
Qonversion.identify("your_custom_user_id");
Qonversion.identify("your_custom_user_id")
Qonversion.identify("your_custom_user_id");
Qonversion.identify('your_custom_user_id');

🚧

Always use unique user ID values. Otherwise, a user can get matched to another user's premium status.

To check permissions for identified users, you can simply call Qonversion.checkPermissions()
You can check the details of setting up permissions here.

Logging out

You need to call logout() method to handle permissions for an unauthorized user.
Call this method when a user logs out within your app:

Qonversion.logout()
[Qonversion logout];
Qonversion.logout();
Qonversion.logout()
Qonversion.logout();
Qonversion.logout();

When a user logs back into his account, don't forget to use identify method again.

Examples

Let's look at the following examples to understand Qonversion.identify() better.

🚧

In the following examples:

  • Anonymous ID corresponds to the same app store account (Apple or Google).
  • A and B correspond to two different app store accounts (Apple or Google).

Example 1. No User Identity.

Two anonymous users install the app and subscribe without using Qonversion.identify(). These users are not linked to each other and have different access.

Anonymous ID

User ID

Action

A

null

Install

B

null

Install

B

null

Start Subscription X

A

null

Start Subscription Y

Now let's look at using Qonversion.identify().

Example 2. Default multiple devices subscription flow.

A user installs the app on his iPhone first. Later he installs the app on his second device (iPad/Android device/etc). He makes a purchase and creates an account on the second device. Later he uses the same credentials to log into the app on his iPhone.

Anonymous ID

User ID

Action

A

null

Install

B

null

Install

B

null

Start Subscription

B

user_id_1

Qonversion.identify("user_id_1")

A

user_id_1

Qonversion.identify("user_id_1")

In this case, Qonversion will provide users A and B the same permissions while they use the same user_id_1.

Example 3. Log in & Log out. One anonymous user.

A user installed the app and subscribed for product X.
Then, he creates his user account in the app with the following ID: user_id_1.
Then he makes another purchase of the product Y using the same app store account.
In this case, the user has permissions based on both products X and Y.
When the user logs out on this device he still has permissions based on both products since the purchases were made using the same app store account.

Anonymous ID

User ID

Action

A

null

Install

A

null

Start Subscription X

A

user_id_1 (login for the very first time)

Qonversion.identify("user_id_1")

A

user_id_1

Start Subscription Y

A

null

Logout

Example 4. Log in & Log out. Two different anonymous users.

First user B installed the app and subscribed for the product X. He then logs into the account with user ID user_id_1 and subscribed for product Y. This user has permissions based on both products.

Another user A installed the app and logged in using the same user ID: user_id_1. He is immediately granted permissions based on both products purchased by user B.

If user B logs out using the logout() method, he still has permissions based on both purchases he made.
If user A logs out, he does not have any permissions. His anonymous account does not have any purchases associated with him.

Anonymous ID

User ID

Action

A

null

Install

B

null

Install

B

null

Start Subscription X

B

user_id_1 (login for the very first time)

Qonversion.identify("user_id_1")

A

user_id_1

Qonversion.identify("user_id_1")

B

user_id_1

Start Subscription Y

B

null

Log out

A

null

Log out

Example 5. Different anonymous accounts and different purchases.

Two anonymous users installed the app. User A subscribed to product Х, and user B subscribed to product Y.
User A then logs with the ID user_id_1 for the very first time. At this moment, this user ID is created.
Later user B also logs into the account under the same ID user_id_1.
Both users, when logged in, have only permissions associated with product Х because the user ID was created from the account associated with purchase Х.
If user A logs out, he still has permissions based on product Х.
If user B logs out, he loses permissions based on product Х but gets back permissions based on product Y which was initially associated with his anonymous account.

Anonymous ID

User ID

Action

A

null

Install

A

null

Start Subscription X

B

null

Install

B

null

Start Subscription Y

A

user_id_1 (login for the very first time)

Qonversion.identify("user_id_1")

B

user_id_1

Qonversion.identify("user_id_1")

Updated 3 months ago


User Identifiers


Setting User ID and cross-platform User Identity to manage user access on multiple devices

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.