Skip to content

Digital Goods API Testing on Chrome PWA: unsupported context #57

Open
@skeddles

Description

@skeddles
	if ('getDigitalGoodsService' in window && window.getDigitalGoodsService) {
		try {
		  await window.getDigitalGoodsService('https://play.google.com/billing');
		  console.log('billing is supported');
	  
		} catch (error:any) {
			console.log('error:', error);
			console.log('billing is supported but failed to connect: '+error.message);
		  return;
		}
	  } else {
		console.log('billing is not supported');
	  }

This code throws Operation Error: unsupported context, and logs billing is supported but failed to connect: unsupported context

Tried:

  • ensured I am on Android 9 or greater (11)
  • enabled phone developer options
  • installed chrome 101 or newer (v133.0.6946.121)
  • enable the #enable-debug-for-store-billing flag in Chrome under chrome://flags
  • using a self signed certificate made with makecert/openssl (gave cert warnings)
  • making myself a trusted CA (still gave cert warning)
  • launching site through ngrok (which gives you https - cert seems valid)
  • added "playBilling": {"enabled": true} to manifest.json
  • restarted android chrome / entire phone
  • pushed to production and accessed through domain
  • installed the local site as a PWA app
  • installed the live production site as a PWA
  • tried to enable the Chrome Origin Trial for Digital Goods API v2 (ended in 2022, and allegedly was shipped with android chrome 101)

The only thing that actually worked and enabled my code to return billing is supported was to push this code to my production site and access it through my bundled android app which is uploaded to a google play test track. But this means I can only test in production.

This site (and many others) imply that it should be possible to debug through android chrome: https://developer.chrome.com/docs/android/trusted-web-activity/receive-payments-play-billing

The same for the PaymentRequest api, seems to only work in my android app on production.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions