Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base Plans are not supported in bubblewrap twa subscriptions #830

Open
tintin10q opened this issue Oct 14, 2023 · 0 comments
Open

Base Plans are not supported in bubblewrap twa subscriptions #830

tintin10q opened this issue Oct 14, 2023 · 0 comments

Comments

@tintin10q
Copy link

I am working on a new twa that is close to launching but I am currently a bit lost on how to get subscription base plans to work in a bubble wrap twa.

Describe the bug

Base plans are not supported in a bubble wrap TWA. You can only query the base plan selected as backwards compatible.

I have enabled google play billing during bubblewrap setup. Like described here. This is also the guide I am following to implement the payment request.

So I have a subscription (in the google play console) with the id: premium_membership.

This subscription has 3 base plans:

  • premium-membership
  • premium-membership-half-yearly
  • premium-membership-yearly

The premium-membership base plan is the one marked as the backwards compatible base plan for the premium_membership subscription.

I expected that I would be able to query the information about the base plans like this:

const service = await window.getDigitalGoodsService('https://play.google.com/billing');
const details = await service.getDetails(['premium-membership', 'premium-membership-half-yearly', 'premium-membership-yearly']); 
console.log(details); // empty list

But this does not work. You can only do getDetails for the subscription id. In this case that is premium_membership.

A PaymentRequest also does not work with base plans. You get an error if you try to make an payment request with a base plan. See below.

To Reproduce

Steps to reproduce the behavior:

First do this setup:

  1. Go to the developer console
  2. Make a subscription
  3. Make a couple base plans

Then: Try to query the details for a baseplan with the code above.

Or try to subscribe to a baseplan with something like

await new PaymentRequest([{supportedMethods: "https://play.google.com/billing", data:{ sku: 'premium-membership-half-yearly'  }}], {}).show();

You will get Payment app returned RESULT_CANCELED code. This is how payment apps can close their activity programmatically.

The PaymentRequest only works with the subscription id, which in this case is premium_membership. This payment request will give you the base plan that you have marked as backwards compatible in the google play console. To me it seems currently impossible to subscribe to other base plans of a subscription in a bubble wrap twa.

Work around

As I currently cannot access the base plans besides the backwards compatible one. You would be forced to make different subscriptions for each subscription duration. This is really inconvenient because these different subscriptions are not really linked in any way. This means that it makes it impossible for a subscriber to upgrade or downgrade their current subscription without canceling it and resubscribing to a different subscription.

Expected behavior

I expect the subscription base plans to work in the bubblewrap twa.

Smartphone (please complete the following information):

  • OS: Android 13
  • Browser Chrome
  • Version: 116

Additional context

On the android website it says:

By November 1, 2023, all updates to existing apps must use Billing Library version 5 or newer.

Does this mean I can not publish updates to my app after November 1? Or is the twa actually using using version 5 but the javascript interface just has not been updated yet? I also found this project: android-browser-helper which seems to be included in the build.grade generated by bubblewrap. I looked at this for a bit and it seems that this project actually provides the javascript bridge to the android Billing Library version 5. Is it correct that this the actual thing that needs to be updated in order to subscribe to base plans?

Am I missing something? I could not find anyone talking about not being able to select a base plan in a bubblewrap twa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant