Merge pull request #28 from SkaterDad/Amazon-Fix-NPE

Fix crashes when using Amazon provider
This commit is contained in:
Björn Ritzl 2020-10-20 11:12:15 +02:00 committed by GitHub
commit 5c806a990d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,6 +45,7 @@ public class IapAmazon implements PurchasingListener {
this.activity = activity;
this.autoFinishTransactions = autoFinishTransactions;
this.listProductsListeners = new HashMap<RequestId, IListProductsListener>();
this.listProductsCommandPtrs = new HashMap<RequestId, Long>();
this.purchaseListeners = new HashMap<RequestId, IPurchaseListener>();
PurchasingService.registerListener(activity, this);
}
@ -96,6 +97,10 @@ public class IapAmazon implements PurchasingListener {
}
PurchasingService.notifyFulfillment(receipt, FulfillmentResult.FULFILLED);
}
public void acknowledgeTransaction(final String purchaseToken, final IPurchaseListener purchaseListener) {
// Stub to prevent errors.
}
private void doGetPurchaseUpdates(final IPurchaseListener listener, final boolean reset) {
synchronized (purchaseListeners) {