GoogleChrome / GoogleChrome/android-browser-helper
DigitalGoodsApi clientAppUnavailable rejection on service
- Dominant language
- Java
- Stars
- 832
- Forks
- 370
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 6
Description
I trying to integrate DigitalGoodsApi. All works fine until the point when calling any `service` function from the `getDigitalGoodsService` callback.
window.getDigitalGoodsService('https://play.google.com/billing').then((service) => {
return service.getDetails(['test']);
})
This will throw `DomException: clientAppUnavailable`
`service` is however a proper instance of the goods API. Function `getDetails`, `listPurchases` and other's are available, but try to call any of them will throw the error.
Most of the source code bellow is generated directly from https://www.pwabuilder.com/.
Tried on Android API 24 and API 30 within emulator.
Chrome version 110 on both API versions (So this should not require any origin trials anymore)
CompileSDK Target is 33 (tried with 30 and 31 as well)
The counterpart delegation service is simple
```
public class DelegationService extends com.google.androidbrowserhelper.trusted.DelegationService {
@Override
public void onCreate() {
super.onCreate();
registerExtraCommandHandler(new DigitalGoodsRequestHandler(getApplicationContext()));
}
}
```
Gradle deps
```
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.google.androidbrowserhelper:billing:1.0.0-alpha09'
implementation 'com.google.androidbrowserhelper:androidbrowserhelper:2.4.0'
}
```
Android Manifest contains
```
```
Contributor guide
Assessment
This issue has not been assessed yet.