Migrating In-App Subscriptions

How to migrate subscriptions from other platforms

You can migrate your subscriptions to Qonversion if you either have your own infrastructure or use some other 3-rd party service. There are two modes available at Qonversion:

  • Observer Mode
  • Infrastructure Mode

The migration process depends on what mode you are planning to use. You can read more about the modes here.

1. Observe Mode Migration

Import your subscription data to have historical data while using Observe Mode.

📘

Please note that data import is available only on the Starter plan.

The migration will allow:

  • to see historical data in Qonversion analytics;
  • Qonversion to validate user receipts to check subscription status changes like subscription renewal or cancellation;
  • new subscription events of your existing users to be sent to active integrations (the events happened before the migration won't be sent);

Prepare the data

Make sure you have the following data:

iOS

Field

Required

Description

user_id

yes

User Identifier in your backend

receipt

yes

The Base64 encoded receipt data.

product_id

yes

The unique identifier of the product purchased.

original_id

yes

The transaction identifier of the original purchase. See the details here: original_transaction_id

price

yes

example: 12.99

introductory_price

yes

for apple promo offers

currency

yes

Android

Field

Required

Description

user_id

yes

User Identifier in your backend

purchase_token

yes

The Base64 encoded receipt data.

product_id

yes

The unique identifier of the product purchased.

original_id

yes

The original transaction ID, see the details here: orderId for Google

Additional Data for Analytics Enrichment

You can provide the following data to enhance analytics options in Qonversion:

Field

Required

Description

idfv

no

iOS Only

idfa

no

iOS Only

gaid

no

Android Only

aaid

no

Android Only

local

no

country

no

model

no

os_version

no

Migrate with export-data

Contact us via email, and provide two csv files: iOS and Android.

Migrate with REST API

Contact us to get access to the REST API to import data automatically.

Migrate from client-side

You need to trigger restore for iOS and syncPurchases for Android only once. So Qonversion can sync the subscriber data with the first launch when Qonversion is implemented.

🚧

iOS Only

Triggering restore will prompt a user to sign in to their Apple ID if they are not signed in already.

Here is the code sample showing how to check and save that a purchase has been restored for a user on the device.

let keyForRestored = "isRestored"
let isRestored = UserDefaults.standard.bool(forKey: keyForRestored)

if isRestored == false {
  Qonversion.restore { (_, _) in }
  UserDefaults.standard.setValue(true, forKey: keyForRestored)
}
NSString *keyForRestoredFlag = @"isRestored";
BOOL isRestored = [[NSUserDefaults standardUserDefaults] boolForKey:keyForRestoredFlag];

if (isRestored == false) {
  [Qonversion restoreWithCompletion:^(NSDictionary<NSString *,QNPermission *> * _Nonnull result, NSError * _Nullable error) {}];
  [[NSUserDefaults standardUserDefaults] setBool:YES forKey:keyForRestoredFlag];
}
val preferences = PreferenceManager.getDefaultSharedPreferences(this)
val keyForRestored = "isRestored"
val isRestored = preferences.getBoolean(keyForRestored, false)
if(!isRestored){
    Qonversion.syncPurchases()
    preferences.edit().putBoolean(keyForRestored, true).apply()
}
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
String keyForRestored = "isRestored";
boolean isRestored = preferences.getBoolean(keyForRestored, false);
if (!isRestored) {
    Qonversion.syncPurchases();
    preferences.edit().putBoolean(keyForRestored, true).apply();
}

2. Infrastructure Mode Migration

Use Qonversion SDK methods to create and restore in-app purchases, and to manage user access to the premium features. Qonversion validates user receipts and provides your app with an accurate subscription status. You can quickly implement in-app subscriptions and purchases, no headaches with StoreKit, no need to build your own server for validating subscriptions.

To manage user access to the premium content of your app, you need to configure Products and Permissions in Qonversion.

Discover Product-Center Concept
Create Permissions
Create Products
Check User Permissions


Did this page help you?