iOS 3.+ migration guide
Qonversion iOS SDK 3 contains significant changes in how the library is initialized. Before, you initialized Qonversion using the
Now, instead, you should create a Qonversion Configuration object and provide it to the initialization method as follows:
let configuration = Qonversion.Configuration(projectKey: "projectKey", launchMode: .subscriptionManagement) Qonversion.initWithConfig(configuration)
QONConfiguration *configuration = [[QONConfiguration alloc] initWithProjectKey:@"projectKey" launchMode:QONLaunchModeSubscriptionManagement]; [Qonversion initWithConfig:configuration];
Note that now you should provide a concrete value from the
Qonverion.LaunchMode enum, depending on which mode you use Qonversion. Also, we've renamed our modes to make them clearer for users:
- "Observe" mode becomes Analytics mode,
- "Infrastructure" mode becomes Subscription Management mode.
After the initialization, you can access the Qonversion instance whenever you want as follows:
So you should replace all your Qonversion calls with the construction above.
Also, if you were using
Qonversion.setDebugMode() for testing purposes, you should now call the
setEnvironment(.sandbox) method of the
Qonversion Config before calling Qonversion.initWithConfig().
let configuration = Qonversion.Configuration(projectKey: "projectKey", launchMode: .subscriptionManagement) configuration.setEnvironment(.sandbox) Qonversion.initWithConfig(configuration)
QONConfiguration *configuration = [[QONConfiguration alloc] initWithProjectKey:@"projectKey" launchMode:QONLaunchModeSubscriptionManagement]; [configuration setEnvironment:QONEnvironmentSandbox]; [Qonversion initWithConfig:configuration];
launch method is available anymore, you won't get
QNLaunchResult as a result. The good news is that there are analogues for all the fields you might have been using from there:
userInfo()and get the
qonversionIdfield of the
Qonversion.Userobject from the result,
We are on the way to renaming permissions to entitlements as this naming suits more what it is used for. So, the following objects and methods were renamed in this release:
|Version <3||Version 3+|
Qonversion.Entitlement class contains the same information as the
Qonversion.Permission with minor renaming.
permissionIDwas renamed to
There is no
setUpdatedPurchasesListener method in Qonversion. You should provide
Qonversion.Configuration during the initialization using the
The exact change is made to the
setPermissionsCacheLifetime method. Now you can set the required lifetime using the
setEntitlementsCacheLifetime function while Qonversion initialization.
let configuration = Qonversion.Configuration(projectKey: "projectKey", launchMode: .subscriptionManagement) configuration.setEntitlementsUpdateListener(self) Qonversion.initWithConfig(config)
QONConfiguration *configuration = [[QONConfiguration alloc] initWithProjectKey:@"projectKey" launchMode:QONLaunchModeSubscriptionManagement]; [configuration setEntitlementsCacheLifetime:QONEntitlementsCacheLifetimeThreeMonths]; [Qonversion initWithConfig:configuration];
We've also changed the way the
Automations is used. As in Qonversion, you should use
Automations via the shared instance. On the first access, it will be initialized and returned. Then the initialized instance will be used.
You should access the shared instance of
Automationsstrictly after you initialize Qonversion.
[Qonversion initWithConfig:...]; [[QONAutomations sharedInstance] setDelegate:...];
Also, the methods for working with push notifications were moved from
Automations, so if you were using the following methods:
make sure to make calls from the Automations instance instead of the Qonversion one.
Rest of the changes
Along with the changes described above, there are several technical improvements and other changes in the new major release:
- the deprecated methods
resetUserwas deprecated for a long time and did nothing, so there is nothing to replace this call with, remove the call if you were still using it for some reason.
setUserIdshould be replaced with the
experimentsmethod was removed - we are now working on a new design of A/B experiments;
Qonversion.AttributionSourceenum was renamed to
checkTrialIntroEligibilityForProductIdsmethod was shortened to
- added the new method
userInfo, which returns the information about the current Qonversion user. Now it contains internal Qonversion and identity identifiers. The user info may be extended in future releases;
- added new enum values -
Qonversion.TrialDuration.Unknown, which are used when parsing fails.
- all the classes and functions' namings were fixed for Swift;
- all the class prefixes were changed from
Updated 6 months ago