Giter Site home page Giter Site logo

tempest-tech-ltd / adaptyui-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adaptyteam/adaptyui-android

0.0 0.0 0.0 263 KB

Extension to the Adapty SDK that allows you to easily add purchase screens to your application.

Home Page: https://docs.adapty.io/docs/paywall-builder-getting-started

License: MIT License

Kotlin 100.00%

adaptyui-android's Introduction


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.

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

Adapty.getPaywall("YOUR_PAYWALL_ID") { result ->
    when (result) {
        is AdaptyResult.Success -> {
            val paywall = result.value
            // the requested paywall
        }
        is AdaptyResult.Error -> {
            val error = result.error
            // handle the error
        }
    }
}

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

Adapty.getViewConfiguration(paywall, locale) { result ->
    when(result) {
        is AdaptyResult.Success -> {
            val viewConfiguration = result.value
            // use loaded configuration
        }
        is AdaptyResult.Error -> {
            val error = result.error
            // handle the error
        }
    }
}

In order to display the visual paywall on the device screen, you must first configure it. To do this, call the method AdaptyUI.getPaywallView() or create the AdaptyPaywallView directly:

val paywallView = AdaptyUI.getPaywallView(
    activity,
    paywall,
    products,
    viewConfiguration,
    AdaptyPaywallInsets.of(topInset, bottomInset),
    eventListener,
)

//======= OR =======

val paywallView =
    AdaptyPaywallView(activity) // or retrieve it from xml
...
with(paywallView) {
    setEventListener(eventListener)
    showPaywall(
        paywall,
        products,
        viewConfiguration,
        AdaptyPaywallInsets.of(topInset, bottomInset),
    )
}

After the object has been successfully created, you can add it to the view hierarchy and display on the screen of the device.

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.


adaptyui-android's People

Contributors

vladd-g avatar saihou2 avatar thanh-tempest avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.