Get specific offer from Purchase object Play Billing v5
Asked Answered
W

1

6

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
    
        }
Whiteeye answered 28/5, 2022 at 11:15 Comment(0)
M
4

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).

Misapprehend answered 16/6, 2022 at 11:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.