Observer Mode
Use this mode without changing anything to your existing in-app purchases flow
Observer mode allows you to use Qonversion with your existing in-app subscription flow.
After you installed the SDK follow the steps below.
Launching
Import the Qonversion SDK in your module that is responsible for launching third-party dependencies:
import Qonversion
#import "Qonversion.h"
import com.qonversion.android.sdk.Qonversion;
import com.qonversion.android.sdk.Qonversion
import 'package:qonversion_flutter/qonversion_flutter.dart';
import Qonversion from 'react-native-qonversion';
using QonversionUnity;
Initialize the SDK:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
Qonversion.launch(withKey: "projectKey")
Qonversion.disableFinishTransactions() // call this function if you want to finish StroreKit transactions by yourself, after handling the purchase on your own backend
return true
}
#import "Qonversion.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[Qonversion launchWithKey:@"projectKey"];
[Qonversion disableFinishTransactions]; // call this function if you want to finish StroreKit transactions by yourself, after handling the purchase on your own backend
return YES;
}
public class App extends Application {
@Override
public void onCreate() {
super.onCreate();
Qonversion.launch(this, "projectKey", true);
}
}
public class App : Application {
override fun onCreate() {
super.onCreate()
Qonversion.launch(this, "projectKey", true)
}
}
Qonversion.launch('projectKey', isObserveMode: true);
Qonversion.launchWithKey('projectKey', true);
public class QonversionLauncher : MonoBehaviour
{
private void Start()
{
Qonversion.Launch("projectKey", true);
}
}
Qonversion.launch('projectKey', true);
→ Get your Qonversion Project Key
Installation the SDKs in Observer Mode
If you are using Qonversion SDKs in Observer Mode, please check the Google Play Billing Library version in your in-app subscription implementation. For the library version 3.x.y, you have to use:
- the major version of the Android SDK 2.x.y
- the major version of the Unity SDK 2.x.y
- the major version of the Flutter SDK 3.x.y
- the major version of the React Native SDK 2.x.y
- the major version of the Cordova SDK 0.x.y
In other cases use the latest SDK version.
Set User ID
To match the events from Qonversion to users on other platforms, you need to set the same user ID on both of them:
Qonversion.setProperty(.userID, value: "yourSideUserId")
[Qonversion setProperty:QNPropertyUserID value:@"yourSideUserId"];
Qonversion.setProperty(QUserProperties.CustomUserId, "yourSideUserID");
Qonversion.setProperty(QUserProperties.CustomUserId, "yourSideUserID")
Qonversion.setProperty(QUserProperty.customUserId, 'yourSideUserId');
Qonversion.setProperty(Property.CUSTOM_USER_ID, 'yourSideUserId');
Qonversion.SetProperty(UserProperty.CustomUserId, "yourSideUserId");
Qonversion.setUserId('yourSideUserID');
The user ID improves event delivery rate to the platforms where event attribution is not exclusively based on IDFA or GAID.
Sync Purchases (Android only)
Attention
If you are using Qonversion SDK's in Observer Mode, in-app purchases implementation (including making purchases) is entirely on your side. Do not forget to 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 purchases details.
Android SDK
You need to set up and initialize Google Play Billing Library, see official Android Developer documentation here.
Please, do not use Google Play Billing AIDL library to integrate Qonversion SDK with your application. It was deprecated and is not supported by Qonversion SDK.
To track purchases data with the Android SDK, you must call synchPurchases()
after every purchase.
Qonversion.syncPurchases();
Qonversion.syncPurchases()
Cross-platform SDKs
To track purchases data with the Cross-platform SDK in observer mode, you must call synchPurchases()
after every purchase.
Qonversion.syncPurchases();
Qonversion.syncPurchases();
Qonversion.SyncPurchases();
Qonversion.syncPurchases();
Updated 1 day ago