GoogleChrome / GoogleChrome/android-browser-helper

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

Open
#498 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
832
Forks
370
Avg merge
1d 3h
Merged PRs (30d)
6

Description

**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

```js
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](https://github.com/user-attachments/assets/0b74826f-7319-4728-b04d-aa967edc5520)

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.