aryal
aryal

Reputation: 71

Get specific offer from Purchase object Play Billing v5

How to identify the specific subscription offer from Purchase object in new Google Play Billing v5 library? I can get the product id but there seems to be now way get offer id or token? In that case how do I notify users if they wish to upgrade/downgrade plans?

    @Override
        public void onPurchasesUpdated(@NonNull BillingResult billingResult,
                                       @Nullable @org.jetbrains.annotations.Nullable List<Purchase> purchases) {
            
            Purchase purchase=purchases.get(0);
//get the exact subscription offer related to this purchase
    
        }

Upvotes: 7

Views: 1234

Answers (1)

Tuan Nguyen
Tuan Nguyen

Reputation: 140

I think when you call launchBillingFlow the purchase dialog will show all the information, from which current plan to which new plan and how will Google charge the fee (ReplaceProrationMode).

But I think the Purchase object should contain the offer or base plan id/tag, imagine the case that I want to disable the base plan that the user is subscribing to prevent the user choose it again (of course purchase dialog will show already subscribed error).

Upvotes: 5

Related Questions