This is the current test setup in Google Play console:
- Test product 1
- Subscription base plan 1: duration 1 month
- Subscription base plan 2: duration 6 months
- Offer 1: 1 week free trial period
The result of queryProductDetailsAsync
are 3 offers:
- Offer 1
- Pricing phase 1: P1M
- Offer 2
- Pricing phase 1: P1W (free)
- Pricing phase 2: P6M
- Offer 3
- Pricing phase 1: P6M
The app dynamically presents all available offers to the user, so that offers can be managed remotely via the Google Play console.
The issue is that the offer 2 appears in addition to offer 3. If a base plan has an offer and the user is eligible for it, I want to hide the base plan (offer 3), as it's kind of redundant because less attractive than P1W (free) + P6M
(offer 2).
On the other hand, if a user already subscribed to P1W (free) + P6M
and cancelled within the free trial period, they should not get the P1W (free) + P6M
but only the base plan P6M
. I assume that is already managed by the Google Billing, as queryProductDetailsAsync
should only return offers that are available to the user.
In the queryProductDetailsAsync
response I see no way to know that offer 2 is using offer 3 as a base plan. They appear as two unrelated offers, which makes it difficult to add any logic in the app to hide the base offer. The only solution I can think of is using offerTags
, add a unique ID to the base plan to be able to associate then with one another.
What is the best approach to hide offer 3 if offer 2 is also available?
It seems that tags is what Google intended to be used, according to docs:
A tag is an optional label of up to 20 characters that you can use to mark or group base plans and offers and identify them in the API. Tags can be used to determine which offer to show when the user is eligible for more than one. You can add up to 20 tags. Users cannot see tags.
Tip: We recommend using tags to identify the offers created with developer-determined eligibility to help differentiate between them when showing the collection of offers available to the user.
It seems to be the only way to identify an offer as part of a base plan. That is surprising because Google Billing already knows that the offer is part of a base plan, why do we have to mess around with custom tags to get that information? Even more surprisingly, the Google Billing API 5.0 has only recently (May 2022) been redesigned but is lacking such a basic feature.