Testing in-app purchases in the Kindle Fire app

I cannot test in-app purchases even with the Amazon Appstore SDK Tester.

public void onPurchaseResponse(final PurchaseResponse purchaseResponse) 

purchaseResponse always has "INVALID_SKU", even if I have an amazon.sdktester.json file with fake JSON.

file contents: {"test": {"itemType": "CONSUMABLE", "price": 0.99, "title": "More clicks!", "description": "Click again ten times!", " smallIconUrl ":" http://www.google.com/images/srpr/logo3w.png "},

 "com.amazon.buttonclicker.ten_clicks" : { "itemType": "CONSUMABLE", "price": 0.99, "title": "More Clicks!", "description": "Click your button ten more times!", "smallIconUrl": "http://www.google.com/images/srpr/logo3w.png" }, "com.amazon.buttonclicker.blue_button" : { "itemType": "ENTITLED", "price": 0.99, "title": "Blue Button", "description": "Button Clicker - Now in Blue!", "smallIconUrl": "http://www.google.com/images/srpr/logo3w.png" } } 

Even the sample application does not work. Do you have any suggestions for testing the application? It seems that the Amazon SDK Tester does not intercept requests.

+4
source share
5 answers

Sounds like magic, but a hard reset solved all my problems.

+1
source

Here's how I got In App purchases to work on the Kindle Fire (after hours of fighting ...)

  • adb install AmazonSDKTester.apk (install SDKTester on Kindle Fire)
  • Create the amazon.sdktester.json file in the sdcard directory (the connected KF appears as sdcard in Finder on ur Mac)
  • The content of amazon.sdktester.json is {"com.yourcompany.yourpkgname.200_coins": {"itemType": "CONSUMABLE", "price": 0.99, "title": "200 COINS", "description": "2 COINS "," smallIconUrl ":" http://www.yourcompany.com/icon.png "}}
  • Press the power button on KF and press the "Disconnect" button. Now KF is no longer mounted on ur Mac.
  • Launch the AmazonSDKTester app in KF.
  • Launch the app from Eclipse. Make sure the package name in JSON matches the SKU in the App Item on the Amazon website and in BuyasingManager.initiatePurchaseRequest ("com.yourcompany.yourpkgname.200_coins");
  • You will now see how In page interstitials appear.
  • Still does not work - force close both applications and AmazonSDKTester on KF; Hard Reset KF; Restart Eclipse and restart from step 1
+4
source

Don't forget the external adjectives {} curly braces in your json. It took me 3 hours until I realized that ...

+2
source

Make sure you press the disconnect button after connecting the USB cable to the computer, otherwise the SDK will not be able to read the JSON file that you moved because the device is mounted at that moment. It found a hard way.

+1
source

I ran into a problem, which is just like your key: in your java code, your element identifier must match your SKU in the json file, in which case it should be: com.amazon.buttonclicker.ten_clicks or com.amazon.buttonclicker.blue_button Here is an example json file for the SampleIAPConsumablesApp and SampleIAPEntitlementsApp project that Amazon defined:

 { "com.amazon.sample.iap.consumable.orange" : { "itemType": "CONSUMABLE", "price": 0.99, "title": "More Clicks!", "description": "Click your button ten more times!", "smallIconUrl": "http://some/image.jpg" }, "com.amazon.sample.iap.entitlement.level2" : { "itemType": "ENTITLED", "price": 0.99, "title": "Blue Button", "description": "Button Clicker - Now in Blue!", "smallIconUrl": "http://some/image.jpg" } } 

Good luck!

0
source

Source: https://habr.com/ru/post/1411863/


All Articles