# v2.2.0

## Presentation controller

{% tabs %}
{% tab title="Swift" %}

```swift
Purchasely.productController(for: "my_product_id",
                                        with: "my_presentation_id"
                                        completion: { (result, plan) in
})
```

{% endtab %}

{% tab title="Objective-C" %}

```objectivec
[Purchasely productControllerFor:@"my_product_id"
													 with:@"my_presentation_id"
											   completion:^(enum PLYProductViewControllerResult result, PLYPlan * _Nullable plan) {
}];
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
Purchasely.productFragment(
    "productVendorId", 
    "presentationVendorId") { result, plan ->
    // result is either Purchase, Cancelled or Restored
}
```

{% endtab %}

{% tab title="Java" %}

```java
Purchasely.productFragment("productVendorId", "presentationVendorId", 
    (result, plan) -> {
        // result is either Purchase, Cancelled or Restored
    }
);
```

{% endtab %}

{% tab title="React Native" %}

```javascript
try {
  await Purchasely.presentProductWithIdentifier('productVendorId', 'presentationVendorId');
} catch (e) {
  console.log(e);
}
```

{% endtab %}
{% endtabs %}

is replaced by 👇

{% tabs %}
{% tab title="Swift" %}

```swift
Purchasely.presentationController(with: "presentationVendorId"
                                completion: { (result, plan) in
})
```

{% endtab %}

{% tab title="Objective-C" %}

```objectivec
Purchasely productControllerWith:@"my_presentation_id"
											   completion:^(enum PLYProductViewControllerResult result, PLYPlan * _Nullable plan) {
}];
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
Purchasely.presentationFragment("presentationVendorId") { result, plan ->
    //result is either Purchase, Cancelled or Restored
}
```

{% endtab %}

{% tab title="Java" %}

```java
Purchasely.presentationFragment("presentationVendorId", (result, plan) -> {
    //result is either Purchase, Cancelled or Restored
})
```

{% endtab %}

{% tab title="React Native" %}

```javascript
try {
  await Purchasely.presentPresentationWithIdentifier('presentationVendorId');
} catch (e) {
  console.log(e);
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
&#x20;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.
{% endhint %}

## Deeplinks

```http
myapp://ply/products/PRODUCT_VENDOR_ID/PRESENTATION_VENDOR_ID
```

is replaced by 👇

```http
myapp://ply/presentations/PRESENTATION_VENDOR_ID
```

## Events

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://purchasely.gitbook.io/purchasely/3.4/faq/migration-guides/sdk/migrate-to-sdk-v3.0/v2.2.0.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
