**Example**: `basePlanId:vendorProductId` or simply `vendorProductId`.
For more details, check the [[official Android Developers documentation](https://developer.android.com/google/play/billing/integrate#personalized-price).
| +| **tagResolver** | optional | Define a dictionary of custom tags and their resolved values. Custom tags serve as placeholders in the paywall content, dynamically replaced with specific strings for personalized content within the paywall. Refer to [Custom tags in paywall builder](https://dev-docs.adapty.io/docs/custom-tags-in-paywall-builder) topic for more details. | +| **timerResolver** | optional | To use custom timers in your mobile app, create an object that follows the `AdaptyTimerResolver` protocol. This object defines how each custom timer should be rendered. If you prefer, you can use a `[String: Date]` dictionary directly, as it already conforms to this protocol. | + +In the example above, `CUSTOM_TIMER_NY` and `CUSTOM_TIMER_6H` are the **Timer ID**s of developer-defined timers you set in the Adapty Dashboard. The `timerResolver` ensures your app dynamically updates each timer with the correct value—for example: + +- `CUSTOM_TIMER_NY`: The time remaining until the timer’s end, such as New Year’s Day. +- `CUSTOM_TIMER_6H`: The time left in a 6-hour period that started when the user opened the paywall. +diff --git a/versioned_docs/version-3.0/ios-present-paywalls.md b/versioned_docs/version-3.0/ios-present-paywalls.md index 124ef15..9ac4a81 100644 --- a/versioned_docs/version-3.0/ios-present-paywalls.md +++ b/versioned_docs/version-3.0/ios-present-paywalls.md @@ -11,7 +11,7 @@ If you've customized a paywall using the Paywall Builder, you don't need to worr :::warning -This guide is for **new Paywall Builder paywalls** only which require SDK v3.0. The process for presenting paywalls differs for paywalls designed with different versions of Paywall Builde, remote config paywalls, and [Observer mode](observer-vs-full-mode). +This guide is for **new Paywall Builder paywalls** only which require SDK v3.0 or later. The process for presenting paywalls differs for paywalls designed with different versions of Paywall Builde, remote config paywalls, and [Observer mode](observer-vs-full-mode). - For presenting **Legacy Paywall Builder paywalls**, check out [iOS - Present legacy Paywall Builder paywalls](ios-present-paywalls-legacy). - For presenting **Remote config paywalls**, see [Render paywall designed by remote config](present-remote-config-paywalls). @@ -21,48 +21,57 @@ This guide is for **new Paywall Builder paywalls** only which require SDK v3.0. ## Present paywalls in Swift -In order to display the visual paywall on the device screen, you must first configure it. To do this, use the method `.paywallController(for:products:introductoryOffersEligibilities:viewConfiguration:delegate:)`: - -```swift title="Swift" -import Adapty -import AdaptyUI - -do { - let visualPaywall = try AdaptyUI.paywallController( - for:
A boolean value controlling [Observer mode](observer-vs-full-mode). Turn it on if you handle purchases and subscription status yourself and use Adapty for sending subscription events and analytics.
The default value is `false`.
🚧 When running in Observer mode, Adapty SDK won't close any transactions, so make sure you're handling it.
| +| **withCustomerUserId** | optional | An identifier of the user in your system. We send it in subscription and analytical events, to attribute events to the right profile. You can also find customers by `customerUserId` in the [**Profiles and Segments**](https://app.adapty.io/profiles/users) menu. | +| **withIdfaCollectionDisabled** | optional |Set to `true` to disable IDFA collection and sharing.
the user IP address sharing.
The default value is `false`.
For more details on IDFA collection, refer to the [Analytics integration](analytics-integration#disable-collection-of-idfa) section.
| +| **withIpAddressCollectionDisabled** | optional |Set to `true` to disable user IP address collection and sharing.
The default value is `false`.
| + +### Activate AdaptyUI module of Adapty SDK + +You need to configure the AdaptyUI module only if you plan to use [Paywall Builder](display-pb-paywalls): + +```dart title="Dart" +try { + final mediaCache = AdaptyUIMediaCacheConfiguration( + memoryStorageTotalCostLimit: 100 * 1024 * 1024, // 100MB + memoryStorageCountLimit: 2147483647, // 2^31 - 1, max int value in Dart + diskStorageSizeLimit: 100 * 1024 * 1024, // 100MB + ); + + await AdaptyUI().activate( + configuration: AdaptyUIConfiguration(mediaCache: mediaCache), + observer:A boolean value controlling [Observer mode](observer-vs-full-mode). Turn it on if you handle purchases and subscription status yourself and use Adapty for sending subscription events and analytics.
The default value is `false`.
🚧 When running in Observer mode, Adapty SDK won't close any transactions, so make sure you're handling it.
| +| **withCustomerUserId** | optional | An identifier of the user in your system. We send it in subscription and analytical events, to attribute events to the right profile. You can also find customers by `customerUserId` in the [**Profiles and Segments**](https://app.adapty.io/profiles/users) menu. | +| **withIdfaCollectionDisabled** | optional |Set to `true` to disable IDFA collection and sharing.
the user IP address sharing.
The default value is `false`.
For more details on IDFA collection, refer to the [Analytics integration](analytics-integration#disable-collection-of-idfa) section.
| +| **withIpAddressCollectionDisabled** | optional |Set to `true` to disable user IP address collection and sharing.
The default value is `false`.
| + +### Activate AdaptyUI module of Adapty SDK + +You need to configure the AdaptyUI module only if you plan to use [Paywall Builder](display-pb-paywalls) and have [installed AdaptyUI module](sdk-installation-ios#install-sdks-via-cocoapods): + +```dart title="Dart" +try { + final mediaCache = AdaptyUIMediaCacheConfiguration( + memoryStorageTotalCostLimit: 100 * 1024 * 1024, // 100MB + memoryStorageCountLimit: 2147483647, // 2^31 - 1, max int value in Dart + diskStorageSizeLimit: 100 * 1024 * 1024, // 100MB + ); + + await AdaptyUI().activate( + configuration: AdaptyUIConfiguration(mediaCache: mediaCache), + observer:A boolean value controlling [Observer mode](observer-vs-full-mode). Turn it on if you handle purchases and subscription status yourself and use Adapty for sending subscription events and analytics. At any purchase or restore in your application, you'll need to call `.restorePurchases()` method to record the action in Adapty. The default value is `false`.
🚧 When running in Observer mode, Adapty SDK won't close any transactions, so make sure you're handling it.
| +| Parameter | Presence | Description | +| -------------------------- | -------- | ------------------------------------------------------------ | +| **AdaptyPublicSdkKey** | required | The key you can find in the **Public SDK key** field of your app settings in Adapty: [**App settings**-> **General** tab -> **API keys** subsection](https://app.adapty.io/settings/general) | +| **AdaptyObserverMode** | optional |A boolean value controlling [Observer mode](observer-vs-full-mode). Turn it on if you handle purchases and subscription status yourself and use Adapty for sending subscription events and analytics. At any purchase or restore in your application, you'll need to call `.restorePurchases()` method to record the action in Adapty. The default value is `false`.
🚧 When running in Observer mode, Adapty SDK won't close any transactions, so make sure you're handling it.
| | **idfaCollectionDisabled** | optional |A boolean parameter, that allows you to disable IDFA collection for your iOS app. The default value is `false`.
For more details, refer to the [Analytics integration](analytics-integration#disable-collection-of-idfa) section.
| ### Configure Adapty SDKs for Android @@ -90,10 +189,10 @@ Parameters: Required parameters: -| Parameter | Presence | Description | -|---------|--------|-----------| -| PUBLIC_SDK_KEY | required |Contents of the **Public SDK key** field in the [**App Settings** -> **General** tab](https://app.adapty.io/settings/general) in the Adapty Dashboard. **SDK keys** are unique for every app, so if you have multiple apps make sure you choose the right one.
Make sure you use the **Public SDK key** for Adapty initialization, since the **Secret key** should be used for [server-side API](getting-started-with-server-side-api) only.
| -| AdaptyObserverMode | optional |A boolean value that is controlling [Observer mode](observer-vs-full-mode) . Turn it on if you handle purchases and subscription status yourself and use Adapty for sending subscription events and analytics.
The default value is `false`.
🚧 When running in Observer mode, Adapty SDK won't close any transactions, so make sure you're handling it.
| +| Parameter | Presence | Description | +| ---------------------------- | -------- | ------------------------------------------------------------ | +| PUBLIC_SDK_KEY | required |Contents of the **Public SDK key** field in the [**App Settings** -> **General** tab](https://app.adapty.io/settings/general) in the Adapty Dashboard. **SDK keys** are unique for every app, so if you have multiple apps make sure you choose the right one.
Make sure you use the **Public SDK key** for Adapty initialization, since the **Secret key** should be used for [server-side API](getting-started-with-server-side-api) only.
| +| AdaptyObserverMode | optional |A boolean value that is controlling [Observer mode](observer-vs-full-mode) . Turn it on if you handle purchases and subscription status yourself and use Adapty for sending subscription events and analytics.
The default value is `false`.
🚧 When running in Observer mode, Adapty SDK won't close any transactions, so make sure you're handling it.
| | AdaptyIDFACollectionDisabled | optional |A boolean parameter, that allows you to disable IDFA collection for your app. The default value is `false`.
For more details, refer to the [Analytics integration](analytics-integration#disable-collection-of-idfa) section.
| @@ -119,12 +218,12 @@ Please keep in mind that for paywalls and products to be displayed in your mobil Adapty logs errors and other crucial information to provide insight into your app's functionality. There are the following available levels: -| Level | Description | -| :------ | :-------------------------------------------------------------------------------------------------------------------------- | -| error | Only errors will be logged. | -| warn | Errors and messages from the SDK that do not cause critical errors, but are worth paying attention to will be logged. | +| Level | Description | +| :------ | :----------------------------------------------------------- | +| error | Only errors will be logged. | +| warn | Errors and messages from the SDK that do not cause critical errors, but are worth paying attention to will be logged. | | info | Errors, warnings, and serious information messages, such as those that log the lifecycle of various modules will be logged. | -| verbose | Any additional information that may be useful during debugging, such as function calls, API queries, etc. will be logged. | +| verbose | Any additional information that may be useful during debugging, such as function calls, API queries, etc. will be logged. | You can set `logLevel` in your app before configuring Adapty. @@ -135,8 +234,11 @@ try { } catch (e) {} ``` +Set to `true` to disable IDFA collection and sharing.
the user IP address sharing.
The default value is `false`.
For more details on IDFA collection, refer to the [Analytics integration](analytics-integration#disable-collection-of-idfa) section.
| | **ipAddressCollectionDisabled** | optional |Set to `true` to disable user IP address collection and sharing.
The default value is `false`.
| +| **LogLevel** | optional | Adapty logs errors and other crucial information to provide insight into your app's functionality. There are the following available levels: