Documentation Index
Fetch the complete documentation index at: https://documentation.qonversion.io/llms.txt
Use this file to discover all available pages before exploring further.
1. Launch SDK
Initialize the SDK:
import Qonversion
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let config = Qonversion.Configuration(projectKey: "[projectKey]", launchMode: .analytics)
Qonversion.initWithConfig(config)
return true
}
#import "Qonversion.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
QONConfiguration *configuration = [[QONConfiguration alloc] initWithProjectKey:@"[projectKey]" launchMode:QONLaunchModeAnalytics];
[Qonversion initWithConfig:configuration];
return YES;
}
import com.qonversion.android.sdk.Qonversion;
import com.qonversion.android.sdk.QonversionConfig;
import com.qonversion.android.sdk.dto.QLaunchMode;
public class App extends Application {
@Override
public void onCreate() {
super.onCreate();
final QonversionConfig qonversionConfig = new QonversionConfig.Builder(
this,
"[projectKey]",
QLaunchMode.Analytics
).build();
Qonversion.initialize(qonversionConfig);
}
}
import com.qonversion.android.sdk.Qonversion
import com.qonversion.android.sdk.QonversionConfig
import com.qonversion.android.sdk.dto.QLaunchMode
public class App : Application {
override fun onCreate() {
super.onCreate()
val qonversionConfig = QonversionConfig.Builder(
this,
"[projectKey]",
QLaunchMode.Analytics
).build()
Qonversion.initialize(qonversionConfig)
}
}
import 'package:qonversion_flutter/qonversion_flutter.dart';
final config = new QonversionConfigBuilder(
'[projectKey]',
QLaunchMode.analytics
).build();
Qonversion.initialize(config);
import Qonversion, {
QonversionConfigBuilder,
LaunchMode,
UserPropertyKey,
} from '@qonversion/react-native-sdk';
const config = new QonversionConfigBuilder(
'[projectKey]',
LaunchMode.ANALYTICS
).build();
Qonversion.initialize(config);
using QonversionUnity;
private void Start()
{
QonversionConfig config = new QonversionConfigBuilder(
"[projectKey]",
LaunchMode.Analytics
).Build();
Qonversion.Initialize(config);
}
const config = new Qonversion.ConfigBuilder(
'[projectKey]',
Qonversion.LaunchMode.ANALYTICS
).build();
Qonversion.initialize(config);
import Qonversion, {
QonversionConfigBuilder,
LaunchMode,
UserPropertyKey,
} from '@qonversion/capacitor-plugin';
const config = new QonversionConfigBuilder(
'[projectKey]',
LaunchMode.ANALYTICS
).build();
Qonversion.initialize(config);
2. Sync Purchases (Android only)
-
Check whether you have set your products up correctly. Make your GooglePlay subscriptions backwards compatible with having the best possible accuracy in Qonversion. Learn more here
-
While you are using Qonversion SDKs in Analytics Mode, in-app purchases implementation is entirely on your side. Please remember to make sure you consume and acknowledge purchases to attribute them to users. Otherwise, the purchases will be automatically refunded in 3 days. See the official Android Developer documentation for processing purchase details.
-
Sync data with Qonversion in your current purchase flow. Call
syncPurchases() after every purchase.
Qonversion.getSharedInstance().syncPurchases();
Qonversion.shared.syncPurchases()
Qonversion.getSharedInstance().syncPurchases();
Qonversion.getSharedInstance().syncPurchases();
Qonversion.GetSharedInstance().SyncPurchases();
Qonversion.getSharedInstance().syncPurchases();
Qonversion.getSharedInstance().syncPurchases();
📘
Please, do not use the Google Play Billing AIDL library to integrate Qonversion SDK with your application. It was deprecated and is not supported by Qonversion SDK.
iOS: there is no syncPurchases() on iOS. Call Qonversion.shared().syncHistoricalData() once on the very first launch after integrating Qonversion to backfill existing subscribers. If your app uses StoreKit2, forward each transaction with Qonversion.shared().handlePurchases([...]) to keep analytics in sync.
3. (Optional) Set User ID
If you want to implement cross-platform (Android, IOS, and Web) user entitlement management, please, follow the User Identity guide.
To match Qonversion revenue events to users in third-party tools, you need to set the identical user IDs in all of them:
Qonversion.shared().setUserProperty(.userID, value: "yourSideUserId")
[[Qonversion sharedInstance] setUserProperty:QONUserPropertyKeyUserID value:@"yourSideUserId"];
import com.qonversion.android.sdk.dto.properties.QUserPropertyKey;
Qonversion.getSharedInstance().setUserProperty(QUserPropertyKey.CustomUserId, "yourSideUserID");
import com.qonversion.android.sdk.dto.properties.QUserPropertyKey
Qonversion.shared.setUserProperty(QUserPropertyKey.CustomUserId, "yourSideUserID")
Qonversion.getSharedInstance().setUserProperty(QUserPropertyKey.customUserId, 'yourSideUserId');
Qonversion.getSharedInstance().setUserProperty(UserPropertyKey.CUSTOM_USER_ID, 'yourSideUserId');
Qonversion.GetSharedInstance().SetUserProperty(UserPropertyKey.CustomUserId, "yourSideUserId");
Qonversion.getSharedInstance().setUserProperty(Qonversion.UserPropertyKey.CUSTOM_USER_ID, 'yourSideUserId');
Qonversion.getSharedInstance().setUserProperty(UserPropertyKey.CUSTOM_USER_ID, 'yourSideUserId');
The user ID improves the quality of events matching to the platforms where event attribution is not exclusively based on IDFA or GAID.
4. (Optional) Set IDFA (Identifier for Advertisers, iOS 14.5+ only)
On iOS 14.5+, after requesting the app tracking permission using ATT, you need to notify Qonversion if tracking is allowed and IDFA is available. This will help to have precise attribution in Adjust, AppsFlyer, Singular and other Qonversion integrations.
ATTrackingManager.requestTrackingAuthorization { status in
switch status {
case .authorized:
Qonversion.shared().collectAdvertisingId()
// handle other states below
}
}
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
switch (status) {
case ATTrackingManagerAuthorizationStatusAuthorized:
[[Qonversion sharedInstance] collectAdvertisingId];
break;
// handle other states if needed
default:
break;
}
}];
Qonversion.getSharedInstance().collectAdvertisingId();
Qonversion.getSharedInstance().collectAdvertisingId();
Qonversion.GetSharedInstance().CollectAdvertisingId();
Qonversion.getSharedInstance().collectAdvertisingId();
Qonversion.getSharedInstance().collectAdvertisingId();
5. (Optional) Set ASID (App set ID, Android 12+ only)
On Android 12+, you can provide an App set ID to have it used in Qonversion integrations.
Add com.google.android.gms:play-services-appset as the dependency to your project and write the following code.
import com.qonversion.android.sdk.dto.properties.QUserPropertyKey;
final AppSetIdClient client = AppSet.getClient(context);
final Task<AppSetIdInfo> task = client.getAppSetIdInfo();
task.addOnSuccessListener(info -> {
final String id = info.getId();
Qonversion.getSharedInstance().setUserProperty(QUserPropertyKey.AppSetId, id);
});
import com.qonversion.android.sdk.dto.properties.QUserPropertyKey
val client = AppSet.getClient(requireContext())
client.appSetIdInfo.addOnSuccessListener { info: AppSetIdInfo ->
Qonversion.shared.setUserProperty(QUserPropertyKey.AppSetId, info.id)
}
Qonversion.getSharedInstance().setUserProperty(QUserPropertyKey.appSetId, appSetId);
Qonversion.getSharedInstance().setUserProperty(UserPropertyKey.APP_SET_ID, appSetId);
Qonversion.GetSharedInstance().SetUserProperty(UserPropertyKey.AppSetId, appSetId);
Qonversion.getSharedInstance().setUserProperty(Qonversion.UserPropertyKey.APP_SET_ID, appSetId);
Qonversion.getSharedInstance().setUserProperty(UserPropertyKey.APP_SET_ID, appSetId);