Swiftpack.co - adaptyteam/AdaptyUI-iOS as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by adaptyteam.
adaptyteam/AdaptyUI-iOS 2.1.2
Extension to the Adapty SDK that allows you to easily add purchase screens to your application.
⭐️ 24
🕓 6 days ago
iOS
.package(url: "https://github.com/adaptyteam/AdaptyUI-iOS.git", from: "2.1.2")


Adapty UI

AdaptyUI is an open-source framework that is an extension to the Adapty SDK that allows you to easily add purchase screens to your application. It’s 100% open-source, native, and lightweight.

1. Fetching Paywalls & ViewConfiguration

Paywall can be obtained in the way you are already familiar with:

import Adapty

Adapty.getPaywall("YOUR_PAYWALL_ID") { result in
    switch result {
    case let .success(paywall):
        // use loaded paywall
    case let .failure(error):
        // handle the error
    }
}

After fetching the paywall call the AdaptyUI.getViewConfiguration(paywall:locale:) method to load the view configuration:

import Adapty

AdaptyUI.getViewConfiguration(paywall: paywall, locale: "en") { result in
    switch result {
    case let .success(viewConfiguration):
        // use loaded configuration
    case let .failure(error):
        // handle the error
    }
}

2. Presenting Visual Paywalls

In order to display the visual paywall on the device screen, you must first configure it. To do this, call the method .paywallController(for:products:viewConfiguration:delegate:):

import Adapty
import AdaptyUI

let visualPaywall = AdaptyUI.paywallController(
    for: <paywall object>,
    products: <paywall products array>,
    viewConfiguration: <ViewConfiguration>,
    delegate: <AdaptyPaywallControllerDelegate>
)

After the object has been successfully created, you can display it on the screen of the device:

present(visualPaywall, animated: true)

3. Full Documentation and Next Steps

We recommend that you read the full documentation. If you are not familiar with Adapty, then start here.

Contributing

  • Feel free to open an issue, we check all of them or drop us an email at [email protected] and tell us everything you want.
  • Want to suggest a feature? Just contact us or open an issue in the repo.

Like AdaptyUI?

So do we! Feel free to star the repo ⭐️⭐️⭐️ and make our developers happy!

License

AdaptyUI is available under the MIT license. Click here for details.


GitHub

link
Stars: 24
Last commit: Yesterday
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics