Skip to content

DigitalGoodsService not working after app installation, have to close the app and reopen to work #498

@fabiel-leon-autofact

Description

@fabiel-leon-autofact

Describe the bug
After installation the DigitalGoodsService api is unavailable DigitalGoodsService error: OperationError: clientAppUnavailable clientAppUnavailable , i have to close the app and reopen to have access
iam executing this code

 try {
     const e = await window.getDigitalGoodsService("https://play.google.com/billing");
     if (e) {
        const s = await e.listPurchases();
        console.log("Second verifications: ", s),
        this.result = !0
      }
     } catch (e) {
        console.error("DigitalGoodsService error:", e)
     }

To Reproduce
Steps to reproduce the behavior:

  1. Install an app that List purchases on first render
  2. Open the app after installation and crash
  3. Close the app and reopen <<- IT WORKS
  4. uninstall and repeat from step 1

Expected behavior
Digital goods api should work after installation

Did this ever used to work
IDK, first time using twa.

Screenshots
Image

Smartphone (please complete the following information):

  • Device: Pixel 8 Pro API 35 , and others phones
  • OS: Android 15
  • Browsers Installed Chrome
  • Browser Versions 133.0.6943.21
  • 'com.google.androidbrowserhelper:androidbrowserhelper:2.5.0'
    'com.google.androidbrowserhelper:billing:1.0.0-alpha11'

Additional context
Add any other context about the problem here.

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