v2.2.0

Until this version, presentations were tied to a specific product. This constraint made multi-product presentations impossible and version 2.2.0 prepares app code to unlock that possibility.

Presentation controller

Swift
Objective-C
Kotlin
Java
React Native
Swift
Purchasely.productController(for: "my_product_id",
with: "my_presentation_id"
completion: { (result, plan) in
})
Objective-C
[Purchasely productControllerFor:@"my_product_id"
with:@"my_presentation_id"
completion:^(enum PLYProductViewControllerResult result, PLYPlan * _Nullable plan) {
}];
Kotlin
Purchasely.productFragment(
"productVendorId",
"presentationVendorId") { result, plan ->
// result is either Purchase, Cancelled or Restored
}
Java
Purchasely.productFragment("productVendorId", "presentationVendorId",
(result, plan) -> {
// result is either Purchase, Cancelled or Restored
}
);
React Native
try {
await Purchasely.presentProductWithIdentifier('productVendorId', 'presentationVendorId');
} catch (e) {
console.log(e);
}

is replaced by 👇

Swift
Objective-C
Kotlin
Java
React Native
Swift
Purchasely.presentationController(with: "presentationVendorId"
completion: { (result, plan) in
})
Objective-C
Purchasely productControllerWith:@"my_presentation_id"
completion:^(enum PLYProductViewControllerResult result, PLYPlan * _Nullable plan) {
}];
Kotlin
Purchasely.presentationFragment("presentationVendorId") { result, plan ->
//result is either Purchase, Cancelled or Restored
}
Java
Purchasely.presentationFragment("presentationVendorId", (result, plan) -> {
//result is either Purchase, Cancelled or Restored
})
React Native
try {
await Purchasely.presentPresentationWithIdentifier('presentationVendorId');
} catch (e) {
console.log(e);
}

If you have multiple products inside the same app, don't forget to specify the presentationId and don't set it to nil otherwise you will be falling back to the app default presentation.

Deeplinks

myapp://ply/products/PRODUCT_VENDOR_ID/PRESENTATION_VENDOR_ID

is replaced by 👇

myapp://ply/presentations/PRESENTATION_VENDOR_ID

Events

PLYEvent.productPageViewed is replaced by PLYEvent.presentationViewed (PRODUCT_PAGE_VIEWED to PRESENTATION_VIEWED in React Native).