libgdx / gdx-pay

A libGDX cross-platform API for InApp purchasing.
Apache License 2.0
225 stars 83 forks source link

Googlebilling: Better exceptions on handleInstallError #173

Closed MrStahlfelge closed 5 years ago

MrStahlfelge commented 5 years ago

(This is just a memo for me, I will implement this in the future)

When the purchaseManager can't be installed, observer's handleInstallError method is called. At the moment, it can't get recognized by a surrounding game why this is the case. The following reasons are interesting to show a special error message helping the user:

For these cases, special Exceptions in gdx-client should be introduced extending GdxPayException and raised (NoNetworkException and ServiceNotAvailableException).

Documentation Concerned line in code

MrStahlfelge commented 5 years ago

After testing, I noticed that Billing library will not return a dedicated error code when network connection is not available. Instead, onSkuResponse is called with return code 6 (Error) leading to a GdxPayException with description "onSkuDetailsResponse failed, status code is 6". I will change this developer-type message to be more user-friendly.