I’m using the Corona amazon plugin in build.settings:
[“plugin.amazon.iap”] = { publisherId = “com.coronalabs”,supportedPlatforms = { [“android-kindle”] = true } },
For Google Play, when I call store.init(callBack), the callBack event returns with transaction=“initialized”, after which I load_products. However, because Amazon doesn’t return any callback from store.init, I follow store.init with a check if store=amazon and if so, I then load_products. This solved problem #1, as I can see the entire list of products.
Also, for Google Play, when a purchase is completed, to complete the transaction, I had to use store.consumePurchase(productList,transactionCallback). However, for Amazon, to complete the transaction, I then use store.finishTransaction(transaction). This solved problem #2, as the purchase completes.
@agramonte, thank you for your help in pointing me to install the Amazon App Tester on my amazon device. Your help made a big difference! If I didn’t have 3 games already using my own code for purchases, which is working and debugged, I would use Badger, so thank you for that referral, too. I plan to use IAP Badger in the future to avoid having to manage these issues myself. Again, thank you.
For others looking to avoid IAP issues, follow @agramonte’s advice and use https://marketplace.coronalabs.com/corona-plugins/iap-badger
To download the Amazon App Tester, go to https://developer.amazon.com/docs/in-app-purchasing/iap-install-and-configure-app-tester.html
After you download the JSON IAP file from the Amazon manage-apps in-app purchases section, you’ll push it to the amazon device so that the app tester will know what products to simulate. To do this push, use the command line “adb” to your Amazon device as follows:
$ adb push [_Your_JSON_File_Folder_]/amazon.sdktester.json /mnt/sdcard/amazon.sdktester.json