Search code examples
androidin-app-billing

integrate In-app Promotions


I am using the in-app billing in my android application, but I do not know how to integrate the in-app promotion with my app. I have tried to read this resource here, but I didn't understand any thing. the application is providing the payment methods except the redeem, please any help how to integrate it? note: I'm using in-app billing v3


Solution

  • Integration of the in-app promotion with App Google provided a descriptive documentation which you can refer to implement in-app promotion.

    Official Documentation says,

    If your app supports the in-app purchase workflow(described in Making In-app Billing requests), your app automatically supports in-app redemption of promo codes.

    Here are some details

    Supporting Promo Codes in Your App

    To support promotion codes, your app must call the getPurchases() method whenever the app starts or resumes. This method returns a bundle of all current, unconsumed purchases, including purchases the user made by redeeming a promo code.

    Calling getPurchases() on startup and resume guarantees that your app finds out about all purchases and redemptions the user may have made while the app wasn't running. Furthermore, if a user makes a purchase while the app is running and your app misses it for any reason, your app still finds out about the purchase the next time the activity resumes and calls getPurchases().

    Refer this documentation for more details https://developer.android.com/google/play/billing/billing_promotions.html#supporting