App Group Migration Process (Mac)

The macOS SDK supports migrating license activations between versions of your app using data shared between apps in your app group. This feature is useful when your bundle identifier changes between major releases, or you are migrating users to a new incarnation of your app.

The migration process requires 2 steps:

  1. Writing the license activation data to the data container of an app group. The write step is performed automatically by the macOS SDK if you provide an app group to the Paddle delegate. At least the last version of your app should provide the app group to start writing the license activation information.
  2. Reading the license activation data from the data container of an app group. Products can read the license activation data from app groups on demand. The app group is provided directly to the read method.

The license activation information can then be activated using the regular routes to verify the license information.

Reading and writing the license activation data are independent of each other, in that you do not need to implement both in your app. You could enable writing of the license activation data in the last 2 versions of your app, for instance, and enable reading in the first version of your new app.

If you do enable both reading and writing in the same app, remember that activated products in your new app will also write to the data container of your app group. After activation you would be able to immediately read the license activation data from the data container. You should skip the read phase if the product is already activated to prevent repeatedly activating the same license.

Note that activations are linked to a single product. When searching for previous activations in the app group, use the product of your previous app’s release. For instance, if you are writing the activation with product X, you won’t be able to read the activation with product Y because the activation is linked to product X.


Write activation data

In your app using v3 or v4 of the macOS SDK, enable writing of the license activation data by implementing the appGroupForSharedLicense method of the PaddleDelegate.

(NSString *)appGroupForSharedLicense
    return @"appgroup.identifier";

If your app uses v3 of the macOS SDK, call [paddle productActivated] to ensure that the license activation data, if any, is written to the data container of your app group. If your app uses v4 of the macOS SDK, the license activation data will be written when you initialise the product.

// app using v3 macOS SDK
[paddle productActivated];

// app using v4 macOS SDK
[PADProduct alloc] initWithProductID:@"my-product-id"

Read activation data

In your app using v4 of the macOS SDK, read in the license activation data written by your app using the v3 or v4 macOS SDK. Use the same product ID and app group as your previous app version.

[PADProduct alloc] initWithProductID:@"my-product-id"

PADProductAppGroupLicense *license = [product existingLicenseFromAppGroup:@"appgroup.identifier"];
if (license) {
	// Activate product using license, or suggest activation to the user, etc.
} else {
  // No previous license found.

Questions about Paddle?

If you need any help regarding your Paddle integration, please get in touch with our Customer Success team using the form below.