defold / extension-iap

In-app purchase extension for Defold
MIT License
19 stars 12 forks source link

Fix crashes when using Amazon provider #28

Closed SkaterDad closed 3 years ago

SkaterDad commented 3 years ago

Porting my game to Amazon Appstore and came across a couple crashes. I have not tested full functionality of purchasing yet, but I'll be sure to keep you updated on how it goes.

The first commit fixes the error below, a NullPointerException since one of the HashMaps was not initialized.

10-17 11:14:45.564 16211 16268 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.util.HashMap.put(java.lang.Object, java.lang.Object)' on a null object reference
10-17 11:14:45.564 16211 16268 E AndroidRuntime:        at com.defold.iap.IapAmazon.listItems(IapAmazon.java:75)

The second commit puts in a stubbed out acknowledgeTransaction method, since the JNI code was expecting it to be there and crashed.

britzl commented 3 years ago

Thank you for the contribution! The Amazon IAP implementation is rarely used and those using it probably has an older version.