Reputation: 1359
I am not able to test in app purchases even with Amazon Appstore SDK Tester.
public void onPurchaseResponse(final PurchaseResponse purchaseResponse)
purchaseResponse always has "INVALID_SKU" even if I have amazon.sdktester.json file with fake JSON.
file content: { "test" : { "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.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 sample application does not work. Do you have any suggestions how to test application? It seems that Amazon SDK Tester does not intercept requests.
Upvotes: 4
Views: 4203
Reputation: 4520
I have faced with the issue that the same as your, the key is: in your java code, your item id must equal to your SKU in json file, in this case, it must be: com.amazon.buttonclicker.ten_clicks
or com.amazon.buttonclicker.blue_button
Here is the example json file for SampleIAPConsumablesApp
and SampleIAPEntitlementsApp
sample project provied by Amazon:
{
"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"
}
}
Goodluck!
Upvotes: 0
Reputation: 111
Here's how I got the In App purchases to work on Kindle Fire (after several hrs of struggle...)
Upvotes: 4
Reputation: 216
Don't forget the outer enclosing {} braces in your json. It took me 3 hours until I figured that out...
Upvotes: 2
Reputation: 86
Make sure to hit the disconnect button after you connect the usb cable to your pc, otherewise the SDK tester will not be able to read the JSON file you moved over since the device is mounted at that point. Found this out the hard way.
Upvotes: 1