### Run development environment setup Source: https://github.com/revenuecat/purchases-ios/blob/main/Contributing/CONTRIBUTING.md Execute the fastlane setup_dev lane to install Homebrew, SwiftLint, and link the pre-commit hook. ```bash fastlane setup_dev ``` -------------------------------- ### Install Tuist Source: https://github.com/revenuecat/purchases-ios/blob/main/Contributing/DEVELOPMENT.md Installs Tuist and verifies the installation. Follow the official guide for detailed steps. ```bash tuist version ``` -------------------------------- ### Run installation tests Source: https://github.com/revenuecat/purchases-ios/blob/main/Tests/InstallationTests/CarthageInstallation/fastlane/README.md This action executes the installation tests for the project. ```shell [bundle exec] fastlane installation_tests ``` -------------------------------- ### Setup Development Environment Source: https://github.com/revenuecat/purchases-ios/blob/main/Tests/InstallationTests/SPMInstallation/fastlane/README.md Use this action to set up the development environment for iOS projects. ```bash fastlane ios setup_dev ``` -------------------------------- ### Purchases/purchase(product:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/RevenueCat.md Starts a purchase for the given product. This is the async/await version. ```APIDOC ## Purchases/purchase(product:) ### Description Starts a purchase for the given product. This is the async/await version. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response (StoreTransaction) The `StoreTransaction` object representing the completed purchase. #### Response Example ```swift Task { do { let product = try await Purchases.shared.products(["com.revenuecat.monthly_4"]).first if let product = product { let result = try await Purchases.shared.purchase(product: product) // Handle the purchase result } } catch { // Handle error } } ``` ``` -------------------------------- ### Purchases/purchase(product:promotionalOffer:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/RevenueCat.md Starts a purchase for the given product with a promotional offer. This is the async/await version. ```APIDOC ## Purchases/purchase(product:promotionalOffer:) ### Description Starts a purchase for the given product with a promotional offer. This is the async/await version. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response (StoreTransaction) The `StoreTransaction` object representing the completed purchase. #### Response Example ```swift Task { do { let product = try await Purchases.shared.products(["com.revenuecat.monthly_4"]).first if let product = product, let offer = offer { let result = try await Purchases.shared.purchase(product: product, promotionalOffer: offer) // Handle the purchase result } } catch { // Handle error } } ``` ``` -------------------------------- ### Purchases/purchase(package:promotionalOffer:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/RevenueCat.md Starts a purchase for the given package with a promotional offer. This is the async/await version. ```APIDOC ## Purchases/purchase(package:promotionalOffer:) ### Description Starts a purchase for the given package with a promotional offer. This is the async/await version. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response (StoreTransaction) The `StoreTransaction` object representing the completed purchase. #### Response Example ```swift Task { do { let package = try await offerings.current?.availablePackages.first(where: { $0.identifier == "monthly" }) if let package = package, let offer = offer { let result = try await Purchases.shared.purchase(package: package, promotionalOffer: offer) // Handle the purchase result } } catch { // Handle error } } ``` ``` -------------------------------- ### Purchases/purchase(package:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/RevenueCat.md Starts a purchase for the given package. This is the async/await version. ```APIDOC ## Purchases/purchase(package:) ### Description Starts a purchase for the given package. This is the async/await version. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response (StoreTransaction) The `StoreTransaction` object representing the completed purchase. #### Response Example ```swift Task { do { let package = try await offerings.current?.availablePackages.first(where: { $0.identifier == "monthly" }) if let package = package { let result = try await Purchases.shared.purchase(package: package) // Handle the purchase result } } catch { // Handle error } } ``` ``` -------------------------------- ### Install Tuist Dependencies Source: https://github.com/revenuecat/purchases-ios/blob/main/Examples/rc-maestro/README.md Install the necessary dependencies for Tuist. This command should be run after cloning the repository. ```bash tuist install ``` -------------------------------- ### Run XCFramework Installation Tests Source: https://github.com/revenuecat/purchases-ios/blob/main/fastlane/README.md Tests XCFramework integration by building the XCFrameworkInstallationTests app. ```sh [bundle exec] fastlane ios xcframework_installation_tests ``` -------------------------------- ### Prepare for Carthage build Source: https://github.com/revenuecat/purchases-ios/blob/main/Tests/InstallationTests/CarthageInstallation/fastlane/README.md Removes the Examples directory before building with Carthage to prevent unnecessary or problematic scheme resolution. ```shell [bundle exec] fastlane prepare_for_carthage ``` -------------------------------- ### Purchases/purchase(product:promotionalOffer:completion:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/RevenueCat.md Starts a purchase for the given product with a promotional offer asynchronously. This is the completion handler version. ```APIDOC ## Purchases/purchase(product:promotionalOffer:completion:) ### Description Starts a purchase for the given product with a promotional offer asynchronously. This is the completion handler version. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response (StoreTransaction) The `StoreTransaction` object representing the completed purchase. #### Response Example ```swift Purchases.shared.purchase(product: product, promotionalOffer: offer) { (transaction, error) in if let transaction = transaction { // Handle the purchase result } else if let error = error { // Handle error } } ``` ``` -------------------------------- ### Generate Maestro Example App Workspace Source: https://github.com/revenuecat/purchases-ios/blob/main/Contributing/DEVELOPMENT.md Generates the Xcode workspace specifically for the Maestro example application. ```bash tuist generate Maestro ``` -------------------------------- ### Purchases/configure(with:)-6oipy Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/RevenueCat.md Configures the RevenueCat SDK with additional options. This overload allows for more advanced setup. ```APIDOC ## Purchases/configure(with:)-6oipy ### Description Configures the RevenueCat SDK with additional options. This overload allows for more advanced setup. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```swift let configuration = Configuration("YOUR_API_KEY") // Add other configuration options here Purchases.configure(with: configuration) ``` ### Response #### Success Response (Void) Configuration is successful. #### Response Example None (configuration is typically synchronous or handled internally) ``` -------------------------------- ### Purchases/purchase(package:promotionalOffer:completion:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/RevenueCat.md Starts a purchase for the given package with a promotional offer asynchronously. This is the completion handler version. ```APIDOC ## Purchases/purchase(package:promotionalOffer:completion:) ### Description Starts a purchase for the given package with a promotional offer asynchronously. This is the completion handler version. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response (StoreTransaction) The `StoreTransaction` object representing the completed purchase. #### Response Example ```swift Purchases.shared.purchase(package: package, promotionalOffer: offer) { (transaction, error) in if let transaction = transaction { // Handle the purchase result } else if let error = error { // Handle error } } ``` ``` -------------------------------- ### Install Xcode Command Line Tools Source: https://github.com/revenuecat/purchases-ios/blob/main/Tests/InstallationTests/SPMInstallation/fastlane/README.md Ensure you have the latest version of the Xcode command line tools installed before proceeding with Fastlane installation. ```bash xcode-select --install ``` -------------------------------- ### Install fastlane Source: https://github.com/revenuecat/purchases-ios/blob/main/Contributing/CONTRIBUTING.md Use Homebrew to install fastlane, a tool used for automation in the project. ```bash brew install fastlane ``` -------------------------------- ### Purchases/purchase(product:completion:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/RevenueCat.md Starts a purchase for the given product asynchronously. This is the completion handler version. ```APIDOC ## Purchases/purchase(product:completion:) ### Description Starts a purchase for the given product asynchronously. This is the completion handler version. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response (StoreTransaction) The `StoreTransaction` object representing the completed purchase. #### Response Example ```swift Purchases.shared.purchase(product: product) { (transaction, error) in if let transaction = transaction { // Handle the purchase result } else if let error = error { // Handle error } } ``` ``` -------------------------------- ### Purchases/purchase(package:completion:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/RevenueCat.md Starts a purchase for the given package asynchronously. This is the completion handler version. ```APIDOC ## Purchases/purchase(package:completion:) ### Description Starts a purchase for the given package asynchronously. This is the completion handler version. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response (StoreTransaction) The `StoreTransaction` object representing the completed purchase. #### Response Example ```swift Purchases.shared.purchase(package: package) { (transaction, error) in if let transaction = transaction { // Handle the purchase result } else if let error = error { // Handle error } } ``` ``` -------------------------------- ### Setup Git Worktree with Tuist Source: https://github.com/revenuecat/purchases-ios/blob/main/Contributing/DEVELOPMENT.md Commands to set up a new git worktree, ensuring Tuist configurations and dependencies are correctly handled for the new environment. ```bash mise trust ``` ```bash mise run setup-worktree ``` -------------------------------- ### Purchases/getPromotionalOffer(forProductDiscount:product:completion:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Asynchronously gets a promotional offer for a specific product discount and product with a completion handler. ```APIDOC ## Purchases/getPromotionalOffer(forProductDiscount:product:completion:) ### Description Asynchronously gets a `PromotionalOffer` object for a given `ProductDiscount` and `StoreProduct`. Results are returned in the completion handler. ### Method `getPromotionalOffer(forProductDiscount:product:completion:)` ### Endpoint N/A (SDK method) ### Parameters - **discount** (ProductDiscount) - The product discount to get the offer for. - **product** (StoreProduct) - The `StoreProduct` associated with the discount. - **completion** ((Result) -> Void) - A closure that is called with the result of the operation. ### Response - **Result** - Contains either the `PromotionalOffer` (or `nil`) on success or an `Error` on failure. ``` -------------------------------- ### Troubleshooting Tuist Generation Source: https://github.com/revenuecat/purchases-ios/blob/main/Contributing/DEVELOPMENT.md Sequence of commands to perform a clean install and then generate the workspace, useful for resolving issues with missing files after generation. ```bash tuist clean ``` ```bash tuist install ``` ```bash tuist generate ``` -------------------------------- ### Purchases/simulatesAskToBuyInSandbox Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Gets or sets a boolean value that indicates whether to simulate Ask to Buy in the sandbox. ```APIDOC ## Purchases/simulatesAskToBuyInSandbox ### Description Gets or sets a boolean value that indicates whether to simulate Ask to Buy in the sandbox environment. This is useful for testing. ### Method Property access (get/set). ### Endpoint N/A (SDK method) ### Parameters - **simulatesAskToBuyInSandbox** (Bool) - `true` to simulate Ask to Buy, `false` otherwise. ### Response - **simulatesAskToBuyInSandbox** (Bool) - The current value of the simulation setting. ``` -------------------------------- ### Get Offerings using Async/Await Source: https://github.com/revenuecat/purchases-ios/blob/main/Examples/testCustomEntitlementsComputation/README.md Retrieve available offerings using the asynchronous Swift API. This is a modern approach to fetching purchase data. ```swift let offerings = try await Purchases.shared.offerings() ``` -------------------------------- ### Generate Tuist Project with Custom Variables Source: https://github.com/revenuecat/purchases-ios/blob/main/AGENTS.md Example of combining multiple Tuist environment variables to generate a specific project configuration, such as setting a custom API key and launch arguments. ```bash TUIST_RC_API_KEY=appl_xxxxx TUIST_LAUNCH_ARGUMENTS="-EnableWorkflowsEndpoint" tuist generate PaywallsTester ``` -------------------------------- ### Purchases/configure(withAPIKey:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Configures the RevenueCat SDK with your API key. This is the primary method for initializing the SDK. ```APIDOC ## Purchases/configure(withAPIKey:) ### Description Configures the RevenueCat SDK with your API key. This method must be called before using any other SDK features. ### Method `configure(withAPIKey:)` ### Endpoint N/A (SDK method) ### Parameters - **apiKey** (String) - Your RevenueCat public API key. ### Response None. ``` -------------------------------- ### Install Fastlane using RubyGems Source: https://github.com/revenuecat/purchases-ios/blob/main/Tests/InstallationTests/SPMInstallation/fastlane/README.md Install Fastlane using the RubyGems package manager. A sudo prefix may be required depending on your system configuration. ```bash [sudo] gem install fastlane -NV ``` -------------------------------- ### Purchases/verboseLogHandler Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Gets or sets a custom handler for verbose logs. ```APIDOC ## Purchases/verboseLogHandler ### Description Gets or sets a custom handler for verbose logs. This allows you to process verbose log messages in a custom way. ### Method Property access (get/set). ### Endpoint N/A (SDK method) ### Parameters - **verboseLogHandler** ((String) -> Void)? - A closure that accepts a verbose log message string. ### Response - **verboseLogHandler** ((String) -> Void)? - The current custom verbose log handler. ``` -------------------------------- ### Build and Test with Swift Package Manager Source: https://github.com/revenuecat/purchases-ios/blob/main/AGENTS.md Use these commands for building the project and running unit tests via Swift Package Manager. ```bash swift build # Build via SPM swift test # Run unit tests via SPM ``` -------------------------------- ### Prepare Carthage Archive Source: https://github.com/revenuecat/purchases-ios/blob/main/Tests/InstallationTests/SPMInstallation/fastlane/README.md Runs the necessary steps to create a Carthage archive, preparing for Carthage distribution. ```bash fastlane ios carthage_archive ``` -------------------------------- ### Purchases/verboseLogs Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Gets or sets a boolean value that indicates whether verbose logging is enabled. ```APIDOC ## Purchases/verboseLogs ### Description Gets or sets a boolean value that indicates whether verbose logging is enabled. Verbose logs provide more detailed information about SDK activity. ### Method Property access (get/set). ### Endpoint N/A (SDK method) ### Parameters - **verboseLogs** (Bool) - `true` to enable verbose logging, `false` otherwise. ### Response - **verboseLogs** (Bool) - The current value of the setting. ``` -------------------------------- ### Build for tvOS, watchOS, and macOS Source: https://github.com/revenuecat/purchases-ios/blob/main/Tests/InstallationTests/SPMInstallation/fastlane/README.md Builds the application for tvOS, watchOS, and macOS platforms. ```bash fastlane ios build_tv_watch_mac ``` -------------------------------- ### Purchases/getOfferings(completion:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Asynchronously fetches the available offerings for the current user with a completion handler. ```APIDOC ## Purchases/getOfferings(completion:) ### Description Asynchronously fetches the available offerings for the current user. Results are returned in the completion handler. ### Method `getOfferings(completion:)` ### Endpoint N/A (SDK method) ### Parameters - **completion** ((Result) -> Void) - A closure that is called with the result of the fetch operation. ### Response - **Result** - Contains either an `Offerings` object on success or an `Error` on failure. ``` -------------------------------- ### Purchases/promotionalOffer(forProductDiscount:product:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Gets a promotional offer for a specific product discount and product. ```APIDOC ## Purchases/promotionalOffer(forProductDiscount:product:) ### Description Gets a `PromotionalOffer` object for a given `ProductDiscount` and `StoreProduct`. ### Method `promotionalOffer(forProductDiscount:product:)` ### Endpoint N/A (SDK method) ### Parameters - **discount** (ProductDiscount) - The product discount to get the offer for. - **product** (StoreProduct) - The `StoreProduct` associated with the discount. ### Response - **promotionalOffer** (PromotionalOffer?) - The `PromotionalOffer` if available, otherwise `nil`. ``` -------------------------------- ### Purchases/logLevel Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Gets or sets the log level for the RevenueCat SDK, controlling the verbosity of logs. ```APIDOC ## Purchases/logLevel ### Description Gets or sets the log level for the RevenueCat SDK. This controls how much information is logged to the console. ### Method Property access (get/set). ### Endpoint N/A (SDK method) ### Parameters - **logLevel** (LogLevel) - The desired log level (e.g., `.info`, `.debug`, `.error`). ### Response - **logLevel** (LogLevel) - The current log level. ``` -------------------------------- ### Purchases/delegate Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Gets or sets the delegate for the Purchases instance, allowing you to respond to lifecycle events. ```APIDOC ## Purchases/delegate ### Description Gets or sets the delegate for the Purchases instance. The delegate can be used to receive callbacks for various SDK events. ### Method Property access (get/set). ### Endpoint N/A (SDK method) ### Parameters - **delegate** (PurchasesDelegate?) - The delegate object conforming to the PurchasesDelegate protocol. ### Response - **delegate** (PurchasesDelegate?) - The current delegate object. ``` -------------------------------- ### Run fastlane ios setup_dev action Source: https://github.com/revenuecat/purchases-ios/blob/main/Tests/InstallationTests/ReceiptParserInstallation/fastlane/README.md This action is used to set up the development environment for iOS projects. ```shell [bundle exec] fastlane ios setup_dev ``` -------------------------------- ### Run fastlane ios replace_api_key_integration_tests action Source: https://github.com/revenuecat/purchases-ios/blob/main/Tests/InstallationTests/ReceiptParserInstallation/fastlane/README.md Replaces API keys for installation and integration tests. ```shell [bundle exec] fastlane ios replace_api_key_integration_tests ``` -------------------------------- ### Purchases/promotionalOffer(forProductDiscount:product:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/RevenueCat.md Creates a `PromotionalOffer` object for a given product discount and product. This is the async/await version. ```APIDOC ## Purchases/promotionalOffer(forProductDiscount:product:) ### Description Creates a `PromotionalOffer` object for a given product discount and product. This is the async/await version. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response (PromotionalOffer) A `PromotionalOffer` object if the offer is valid and eligible. #### Response Example ```swift Task { do { let product = try await Purchases.shared.products(["com.revenuecat.monthly_4"]).first if let product = product, let discount = product.discount { let offer = try await Purchases.shared.promotionalOffer(forProductDiscount: discount, product: product) // Use the promotional offer } } catch { // Handle error } } ``` ``` -------------------------------- ### Purchases/forceUniversalAppStore Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Gets or sets a boolean value that indicates whether to force the universal App Store. ```APIDOC ## Purchases/forceUniversalAppStore ### Description Gets or sets a boolean value that indicates whether to force the universal App Store. This is useful for testing. ### Method Property access (get/set). ### Endpoint N/A (SDK method) ### Parameters - **forceUniversalAppStore** (Bool) - `true` to force the universal App Store, `false` otherwise. ### Response - **forceUniversalAppStore** (Bool) - The current value of the setting. ``` -------------------------------- ### Purchases/purchase(product:promotionalOffer:completion:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Asynchronously initiates a purchase for a given StoreKit product with a promotional offer and a completion handler. ```APIDOC ## Purchases/purchase(product:promotionalOffer:completion:) ### Description Asynchronously initiates a purchase for a given `StoreProduct` using a specified `PromotionalOffer`. Results are returned in the completion handler. ### Method `purchase(product:promotionalOffer:completion:)` ### Endpoint N/A (SDK method) ### Parameters - **product** (StoreProduct) - The `StoreProduct` to purchase. - **promotionalOffer** (PromotionalOffer) - The `PromotionalOffer` to apply to the purchase. - **completion** ((Result) -> Void) - A closure that is called with the result of the purchase operation. ### Response - **Result** - Contains either a `PurchaseResult` on success or an `Error` on failure. ``` -------------------------------- ### Purchases/finishTransactions Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Gets or sets a boolean value that indicates whether the SDK should finish transactions automatically. ```APIDOC ## Purchases/finishTransactions ### Description Gets or sets a boolean value that indicates whether the SDK should finish transactions automatically. If `true`, the SDK will finish transactions. If `false`, you must finish them manually. ### Method Property access (get/set). ### Endpoint N/A (SDK method) ### Parameters - **finishTransactions** (Bool) - `true` to automatically finish transactions, `false` to handle manually. ### Response - **finishTransactions** (Bool) - The current value of the setting. ``` -------------------------------- ### Purchases/getOfferings(completion:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/RevenueCat.md Fetches available offerings for the user asynchronously. This is the completion handler version of `offerings()`. ```APIDOC ## Purchases/getOfferings(completion:) ### Description Fetches available offerings for the user asynchronously. This is the completion handler version of `offerings()`. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response (Offerings) An `Offerings` object containing available offerings. #### Response Example ```swift Purchases.shared.getOfferings { (offerings, error) in if let offerings = offerings { // Use the offerings } else if let error = error { // Handle error } } ``` ``` -------------------------------- ### Build and upload BinarySizeTest app for Emerge analysis Source: https://github.com/revenuecat/purchases-ios/blob/main/fastlane/README.md Builds the BinarySizeTest application and uploads it to Emerge for binary size analysis. ```shell [bundle exec] fastlane ios build_and_upload_emerge_binary_size_analysis ``` -------------------------------- ### Build for tvOS, watchOS, macOS, and visionOS Source: https://github.com/revenuecat/purchases-ios/blob/main/fastlane/README.md Builds the project for tvOS, watchOS, macOS, and visionOS platforms. ```shell [bundle exec] fastlane ios build_tv_watch_mac_visionos ``` -------------------------------- ### Purchases/purchase(package:promotionalOffer:completion:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Asynchronously initiates a purchase for a given package with a promotional offer and a completion handler. ```APIDOC ## Purchases/purchase(package:promotionalOffer:completion:) ### Description Asynchronously initiates a purchase for a given `Package` using a specified `PromotionalOffer`. Results are returned in the completion handler. ### Method `purchase(package:promotionalOffer:completion:)` ### Endpoint N/A (SDK method) ### Parameters - **package** (Package) - The `Package` to purchase. - **promotionalOffer** (PromotionalOffer) - The `PromotionalOffer` to apply to the purchase. - **completion** ((Result) -> Void) - A closure that is called with the result of the purchase operation. ### Response - **Result** - Contains either a `PurchaseResult` on success or an `Error` on failure. ``` -------------------------------- ### Purchases/allowSharingAppStoreAccount Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Gets or sets a boolean value that indicates whether to allow sharing of App Store accounts. ```APIDOC ## Purchases/allowSharingAppStoreAccount ### Description Gets or sets a boolean value that indicates whether to allow sharing of App Store accounts across devices. This can affect how subscriptions are recognized. ### Method Property access (get/set). ### Endpoint N/A (SDK method) ### Parameters - **allowSharingAppStoreAccount** (Bool) - `true` to allow sharing, `false` otherwise. ### Response - **allowSharingAppStoreAccount** (Bool) - The current value of the setting. ``` -------------------------------- ### Deploy iOS Application Source: https://github.com/revenuecat/purchases-ios/blob/main/Tests/InstallationTests/SPMInstallation/fastlane/README.md Initiates the deployment process for the iOS application. ```bash fastlane ios deploy ``` -------------------------------- ### Purchases/proxyURL Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Gets or sets a proxy URL for RevenueCat requests. This is useful for debugging or custom network configurations. ```APIDOC ## Purchases/proxyURL ### Description Gets or sets a proxy URL for RevenueCat requests. This can be useful for debugging network issues or for custom network configurations. ### Method Property access (get/set). ### Endpoint N/A (SDK method) ### Parameters - **proxyURL** (URL?) - The proxy URL to use for requests. ### Response - **proxyURL** (URL?) - The current proxy URL. ``` -------------------------------- ### Configure SDK with Observer Mode (v4) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/V5_API_Migration_guide.md This is the v4 SDK initialization for observer mode, where RevenueCat does not handle purchases directly. ```swift Purchases.configure(with: .builder(withAPIKey: apiKey) .with(observerMode: true) .build()) ``` -------------------------------- ### Purchases/logHandler Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Gets or sets a custom log handler for the RevenueCat SDK, allowing you to process logs in a custom way. ```APIDOC ## Purchases/logHandler ### Description Gets or sets a custom log handler for the RevenueCat SDK. This allows you to intercept and process log messages. ### Method Property access (get/set). ### Endpoint N/A (SDK method) ### Parameters - **logHandler** ((LogLevel, String) -> Void)? - A closure that accepts a log level and a message string. ### Response - **logHandler** ((LogLevel, String) -> Void)? - The current custom log handler. ``` -------------------------------- ### Copy Local Configuration File Source: https://github.com/revenuecat/purchases-ios/blob/main/Examples/rc-maestro/README.md Copy the sample configuration file to create a local configuration. This is typically done before modifying local secrets. ```bash cp Resources/Local.xcconfig.sample Resources/Local.xcconfig ``` -------------------------------- ### Purchases/getPromotionalOffer(forProductDiscount:product:completion:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/RevenueCat.md Creates a `PromotionalOffer` object for a given product discount and product asynchronously. This is the completion handler version. ```APIDOC ## Purchases/getPromotionalOffer(forProductDiscount:product:completion:) ### Description Creates a `PromotionalOffer` object for a given product discount and product asynchronously. This is the completion handler version. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response (PromotionalOffer) A `PromotionalOffer` object if the offer is valid and eligible. #### Response Example ```swift Purchases.shared.getPromotionalOffer(forProductDiscount: discount, product: product) { (offer, error) in if let offer = offer { // Use the promotional offer } else if let error = error { // Handle error } } ``` ``` -------------------------------- ### Run fastlane ios test_watchos action Source: https://github.com/revenuecat/purchases-ios/blob/main/Tests/InstallationTests/SPMCustomEntitlementComputationInstallation/fastlane/README.md Runs all the watchOS tests. Use 'bundle exec' if fastlane is installed via Bundler. ```shell [bundle exec] fastlane ios test_watchos ``` -------------------------------- ### Purchases/configure(withAPIKey:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/RevenueCat.md Configures the RevenueCat SDK with your API key. This is a fundamental step before using other SDK features. ```APIDOC ## Purchases/configure(withAPIKey:) ### Description Configures the RevenueCat SDK with your API key. This is a fundamental step before using other SDK features. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```swift Purchases.configure(withAPIKey: "YOUR_API_KEY") ``` ### Response #### Success Response (Void) Configuration is successful. #### Response Example None (configuration is typically synchronous or handled internally) ``` -------------------------------- ### Prepare Next Version Source: https://github.com/revenuecat/purchases-ios/blob/main/Tests/InstallationTests/SPMInstallation/fastlane/README.md Prepares the project for the next version release, which may include version bumping and other necessary updates. ```bash fastlane ios prepare_next_version ``` -------------------------------- ### Purchases/appUserID Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Gets the unique App User ID for the current user. This ID is used to identify users across devices and platforms. ```APIDOC ## Purchases/appUserID ### Description Gets the unique App User ID for the current user. This ID is used to identify users across devices and platforms in RevenueCat. ### Method Property access (get). ### Endpoint N/A (SDK method) ### Parameters None ### Response - **appUserID** (String) - The unique App User ID. ``` -------------------------------- ### Purchases/configure(with:)-6oipy Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Configures the RevenueCat SDK with a Configuration object. This provides more advanced configuration options. ```APIDOC ## Purchases/configure(with:)-6oipy ### Description Configures the RevenueCat SDK using a `Configuration` object, allowing for more detailed setup. ### Method `configure(with:)` ### Endpoint N/A (SDK method) ### Parameters - **configuration** (Configuration) - The configuration object containing API key and other settings. ### Response None. ``` -------------------------------- ### Purchases/purchase(product:promotionalOffer:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Initiates a purchase for a given StoreKit product with a promotional offer. ```APIDOC ## Purchases/purchase(product:promotionalOffer:) ### Description Initiates a purchase for a given `StoreProduct` using a specified `PromotionalOffer`. ### Method `purchase(product:promotionalOffer:)` ### Endpoint N/A (SDK method) ### Parameters - **product** (StoreProduct) - The `StoreProduct` to purchase. - **promotionalOffer** (PromotionalOffer) - The `PromotionalOffer` to apply to the purchase. ### Response - **PurchaseResult** - An enum indicating the result of the purchase operation. ``` -------------------------------- ### Run fastlane ios v3_loadshedder_integration_tests action Source: https://github.com/revenuecat/purchases-ios/blob/main/Tests/InstallationTests/SPMCustomEntitlementComputationInstallation/fastlane/README.md Runs the LoadShedder tests (v3) for iOS. Use 'bundle exec' if fastlane is installed via Bundler. ```shell [bundle exec] fastlane ios v3_loadshedder_integration_tests ``` -------------------------------- ### Purchases/purchase(product:completion:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Asynchronously initiates a purchase for a given StoreKit product with a completion handler. ```APIDOC ## Purchases/purchase(product:completion:) ### Description Asynchronously initiates a purchase for a given `StoreProduct`. The result is returned in the completion handler. ### Method `purchase(product:completion:)` ### Endpoint N/A (SDK method) ### Parameters - **product** (StoreProduct) - The `StoreProduct` to purchase. - **completion** ((Result) -> Void) - A closure that is called with the result of the purchase operation. ### Response - **Result** - Contains either a `PurchaseResult` on success or an `Error` on failure. ``` -------------------------------- ### Build Project with Swift Package Manager Source: https://github.com/revenuecat/purchases-ios/blob/main/CLAUDE.md Use this command to build the project using Swift Package Manager. ```bash swift build # Build via SPM ``` -------------------------------- ### Thread-Safe Data Handling with Atomic Source: https://github.com/revenuecat/purchases-ios/blob/main/Contributing/ThreadSafety.md Use `Atomic` to manage a piece of data in a thread-safe manner. It simplifies synchronization for reads and writes to encapsulated values. This example increments an integer. ```swift class Data { private let calls = Atomic(0) func threadSafeIncrement() -> Int { return self.calls.modify {\n calls in calls += 1 return calls } } var threadSafeValue: Int { return self.calls.value } } ``` -------------------------------- ### Purchases/purchase(package:completion:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Asynchronously initiates a purchase for a given package with a completion handler. ```APIDOC ## Purchases/purchase(package:completion:) ### Description Asynchronously initiates a purchase for a given `Package`. The result is returned in the completion handler. ### Method `purchase(package:completion:)` ### Endpoint N/A (SDK method) ### Parameters - **package** (Package) - The `Package` to purchase. - **completion** ((Result) -> Void) - A closure that is called with the result of the purchase operation. ### Response - **Result** - Contains either a `PurchaseResult` on success or an `Error` on failure. ``` -------------------------------- ### Open Xcode Project Source: https://github.com/revenuecat/purchases-ios/blob/main/Examples/rc-maestro/README.md Open the generated Xcode project to run the application. This command assumes the project has already been generated. ```bash open App.xcodeproj ``` -------------------------------- ### Get Offerings using Completion Block Source: https://github.com/revenuecat/purchases-ios/blob/main/Examples/testCustomEntitlementsComputation/README.md Retrieve available offerings using the traditional completion block API. This is useful for older Swift versions or specific callback-based architectures. ```swift Purchases.shared.getOfferings { (offerings, error) in // code to handle here } ``` -------------------------------- ### Add RevenueCat AdMob Adapter via Local Swift Package Manager Source: https://github.com/revenuecat/purchases-ios/blob/main/AdapterSDKs/RevenueCatAdMob/README.md For local development, add the adapter by specifying the local path to the `AdapterSDKs/RevenueCatAdMob` directory. Then, add the `RevenueCatAdMob` product to your target. ```swift .package(path: "path/to/purchases-ios/AdapterSDKs/RevenueCatAdMob") ``` -------------------------------- ### Reentrant Thread-Safe Method with Lock Source: https://github.com/revenuecat/purchases-ios/blob/main/Contributing/ThreadSafety.md Use `Lock(.recursive)` when a thread-safe method might call other thread-safe methods within the same lock, preventing deadlocks. This example demonstrates recursive calls. ```swift class Data { private let lock = Lock(.recursive) private var calls = 0 func threadSafeMethod() -> Int { return self.lock.perform { self.threadSafeIncrement() return self.calls } } private func threadSafeIncrement() { return self.lock.perform { self.calls += 1 } } } ``` -------------------------------- ### Basic Thread-Safe Method with Lock Source: https://github.com/revenuecat/purchases-ios/blob/main/Contributing/ThreadSafety.md Use `Lock` to ensure that a method's operations are performed atomically, preventing concurrent access issues. This example shows a simple counter increment. ```swift class Data { private let lock = Lock() private var calls = 0 func threadSafeMethod() -> Int { return self.lock.perform { self.calls += 1 return self.calls } } } ``` -------------------------------- ### Upload V1 template snapshots to Emerge Source: https://github.com/revenuecat/purchases-ios/blob/main/fastlane/README.md Uploads V1 template snapshots to Emerge using BYOS (Bring Your Own Storage). ```shell [bundle exec] fastlane ios upload_v1_snapshots_to_emerge ``` -------------------------------- ### Record and upload V1 snapshots to Emerge Source: https://github.com/revenuecat/purchases-ios/blob/main/fastlane/README.md Records V1 template snapshots and uploads them to Emerge using BYOS (Bring Your Own Storage). ```shell [bundle exec] fastlane ios record_and_upload_v1_snapshots ``` -------------------------------- ### Purchases/checkTrialOrIntroDiscountEligibility(product:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/RevenueCat.md Checks the eligibility of introductory price offers for a given product. This is the async/await version. ```APIDOC ## Purchases/checkTrialOrIntroDiscountEligibility(product:) ### Description Checks the eligibility of introductory price offers for a given product. This is the async/await version. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response (IntroEligibility) The eligibility status for the given product. #### Response Example ```swift Task { do { let product = try await Purchases.shared.products(["com.revenuecat.monthly_4"]).first if let product = product { let eligibility = try await Purchases.shared.checkTrialOrIntroDiscountEligibility(product: product) // Use the eligibility result } } catch { // Handle error } } ``` ``` -------------------------------- ### Purchases/getCustomerInfo(completion:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Asynchronously fetches the customer's information, including their entitlements and subscription status. ```APIDOC ## Purchases/getCustomerInfo(completion:) ### Description Asynchronously fetches the latest customer information, including active subscriptions and entitlements. Results are returned in the completion handler. ### Method `getCustomerInfo(completion:)` ### Endpoint N/A (SDK method) ### Parameters - **completion** ((Result) -> Void) - A closure that is called with the `CustomerInfo` object or an error. ### Response - **Result** - Contains either a `CustomerInfo` object on success or an `Error` on failure. ``` -------------------------------- ### Purchases/purchase(product:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Initiates a purchase for a given StoreKit product. ```APIDOC ## Purchases/purchase(product:) ### Description Initiates a purchase for a given `StoreProduct`. ### Method `purchase(product:)` ### Endpoint N/A (SDK method) ### Parameters - **product** (StoreProduct) - The `StoreProduct` to purchase. ### Response - **PurchaseResult** - An enum indicating the result of the purchase operation. ``` -------------------------------- ### Run fastlane ios preview_docs action Source: https://github.com/revenuecat/purchases-ios/blob/main/Tests/InstallationTests/ReceiptParserInstallation/fastlane/README.md Previews the generated documentation for the iOS project. ```shell [bundle exec] fastlane ios preview_docs ``` -------------------------------- ### Purchases/checkTrialOrIntroDiscountEligibility(productIdentifiers:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/RevenueCat.md Checks the eligibility of introductory price offers for a list of product identifiers. This is the async/await version. ```APIDOC ## Purchases/checkTrialOrIntroDiscountEligibility(productIdentifiers:) ### Description Checks the eligibility of introductory price offers for a list of product identifiers. This is the async/await version. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response (IntroEligibility) A dictionary mapping product identifiers to their eligibility status. #### Response Example ```swift Task { do { let eligibility = try await Purchases.shared.checkTrialOrIntroDiscountEligibility(productIdentifiers: ["com.revenuecat.monthly_4"]) // Use the eligibility results } catch { // Handle error } } ``` ``` -------------------------------- ### Purchases/getProducts(_:completion:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Asynchronously fetches StoreKit products for the given product identifiers with a completion handler. ```APIDOC ## Purchases/getProducts(_:completion:) ### Description Asynchronously fetches `StoreProduct` objects for a given array of product identifiers. Results are returned in the completion handler. ### Method `getProducts(_:completion:)` ### Endpoint N/A (SDK method) ### Parameters - **productIdentifiers** ([String]) - An array of product identifiers to fetch. - **completion** ((Result<[StoreProduct], Error>) -> Void) - A closure that is called with the result of the fetch operation. ### Response - **Result<[StoreProduct], Error>** - Contains either an array of `StoreProduct` objects on success or an `Error` on failure. ``` -------------------------------- ### Purchases/purchase(package:promotionalOffer:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Initiates a purchase for a given package with a promotional offer. ```APIDOC ## Purchases/purchase(package:promotionalOffer:) ### Description Initiates a purchase for a given `Package` using a specified `PromotionalOffer`. ### Method `purchase(package:promotionalOffer:)` ### Endpoint N/A (SDK method) ### Parameters - **package** (Package) - The `Package` to purchase. - **promotionalOffer** (PromotionalOffer) - The `PromotionalOffer` to apply to the purchase. ### Response - **PurchaseResult** - An enum indicating the result of the purchase operation. ``` -------------------------------- ### Run SwiftLint Linter Source: https://github.com/revenuecat/purchases-ios/blob/main/CLAUDE.md Execute SwiftLint to check for code style and quality issues. ```bash swiftlint # Run linter ``` -------------------------------- ### Configure SDK in Custom Entitlements Computation Mode Source: https://github.com/revenuecat/purchases-ios/blob/main/Examples/testCustomEntitlementsComputation/README.md Configure the RevenueCat SDK once the user has logged in. This is the primary method for initializing the SDK in this specific mode. ```swift Purchases.configureInCustomEntitlementsComputationMode(apiKey: "your_api_key", appUserID: appUserID) ``` -------------------------------- ### Run fastlane ios build_tv_watch_mac action Source: https://github.com/revenuecat/purchases-ios/blob/main/Tests/InstallationTests/ReceiptParserInstallation/fastlane/README.md Builds the project for tvOS, watchOS, and macOS platforms. ```shell [bundle exec] fastlane ios build_tv_watch_mac ``` -------------------------------- ### Purchases/checkTrialOrIntroDiscountEligibility(product:completion:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/RevenueCat.md Checks the eligibility of introductory price offers for a given product asynchronously. This is the completion handler version. ```APIDOC ## Purchases/checkTrialOrIntroDiscountEligibility(product:completion:) ### Description Checks the eligibility of introductory price offers for a given product asynchronously. This is the completion handler version. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response (IntroEligibility) The eligibility status for the given product. #### Response Example ```swift Purchases.shared.checkTrialOrIntroDiscountEligibility(product: product) { (eligibility) in // Use the eligibility result } ``` ``` -------------------------------- ### Purchases/checkTrialOrIntroDiscountEligibility(product:completion:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Asynchronously checks the eligibility of introductory price offers for a single product with a completion handler. ```APIDOC ## Purchases/checkTrialOrIntroDiscountEligibility(product:completion:) ### Description Asynchronously checks the eligibility of introductory price offers for the given `StoreProduct`. Results are returned in the completion handler. ### Method `checkTrialOrIntroDiscountEligibility(product:completion:)` ### Endpoint N/A (SDK method) ### Parameters - **product** (StoreProduct) - The `StoreProduct` to check eligibility for. - **completion** ((Result) -> Void) - A closure that is called with the result of the check. ### Response - **Result** - Contains either the eligibility status on success or an `Error` on failure. ``` -------------------------------- ### Purchases/beginRefundRequest(forProduct:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Begins a refund request for a specific product. ```APIDOC ## Purchases/beginRefundRequest(forProduct:) ### Description Begins a refund request for a specific product. This will present the App Store's refund flow. ### Method `beginRefundRequest(forProduct:)` ### Endpoint N/A (SDK method) ### Parameters - **productIdentifier** (String) - The identifier of the product to request a refund for. ### Response - **refundRequestStatus** (RefundRequestStatus) - The status of the refund request. ``` -------------------------------- ### Run Unit Tests with Swift Package Manager Source: https://github.com/revenuecat/purchases-ios/blob/main/CLAUDE.md Execute unit tests for the project using Swift Package Manager. ```bash swift test # Run unit tests via SPM ``` -------------------------------- ### Run fastlane ios release action Source: https://github.com/revenuecat/purchases-ios/blob/main/Tests/InstallationTests/ReceiptParserInstallation/fastlane/README.md Creates a Carthage archive, exports an XCFramework, and creates a GitHub release. ```shell [bundle exec] fastlane ios release ``` -------------------------------- ### Purchases/getProducts(_:completion:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/RevenueCat.md Fetches `StoreProduct` objects for the given product identifiers asynchronously. This is the completion handler version. ```APIDOC ## Purchases/getProducts(_:completion:) ### Description Fetches `StoreProduct` objects for the given product identifiers asynchronously. This is the completion handler version. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response ([StoreProduct]) An array of `StoreProduct` objects. #### Response Example ```swift Purchases.shared.getProducts(["com.revenuecat.monthly_4", "com.revenuecat.annual_12"]) { (products) in // Use the products } ``` ``` -------------------------------- ### Perform iOS Deployment Checks Source: https://github.com/revenuecat/purchases-ios/blob/main/Tests/InstallationTests/SPMInstallation/fastlane/README.md Runs a series of checks to ensure the project is ready for deployment. ```bash fastlane ios deployment_checks ``` -------------------------------- ### Purchases/checkTrialOrIntroDiscountEligibility(productIdentifiers:completion:) Source: https://github.com/revenuecat/purchases-ios/blob/main/Sources/DocCDocumentation/DocCDocumentation.docc/Purchases.md Asynchronously checks the eligibility of introductory price offers for a list of product identifiers with a completion handler. ```APIDOC ## Purchases/checkTrialOrIntroDiscountEligibility(productIdentifiers:completion:) ### Description Asynchronously checks the eligibility of introductory price offers for the given product identifiers. Results are returned in the completion handler. ### Method `checkTrialOrIntroDiscountEligibility(productIdentifiers:completion:)` ### Endpoint N/A (SDK method) ### Parameters - **productIdentifiers** ([String]) - An array of product identifiers to check eligibility for. - **completion** ((Result<[String: IntroEligibilityStatus], Error>) -> Void) - A closure that is called with the result of the check. ### Response - **Result<[String: IntroEligibilityStatus], Error>** - Contains either a dictionary of eligibility statuses on success or an `Error` on failure. ``` -------------------------------- ### Load and Track Native Ad with RevenueCat Source: https://github.com/revenuecat/purchases-ios/blob/main/AdapterSDKs/RevenueCatAdMob/README.md Use this method to load a native ad and enable RevenueCat tracking. Ensure the adapter forwards callbacks to your delegates and adds tracking. ```swift let adLoader = AdLoader( adUnitID: "AD_UNIT_ID", rootViewController: self, adTypes: [.native], options: nil ) adLoader.delegate = self // Pass nativeAdDelegate here. The adapter forwards callbacks to your delegates and adds tracking. // The adapter uses the loader's adUnitID (set when creating the AdLoader above) for tracking. // Do not replace adLoader.delegate after calling loadAndTrack. Avoid overwriting nativeAd.delegate // and nativeAd.paidEventHandler on loaded ads, or you'll override RevenueCat's listeners. adLoader.loadAndTrack( Request(), placement: "feed", nativeAdDelegate: self ) ```