Question

has anybody tried implementing amazon's in-app purchase? I'm having problem implementing the example on their site. below example, it's giving me INVALID_SKU response:

when purchase is initiated,

PurchasingManager.initiateItemDataRequest("DeveloperSKU-1234");

the response of above will be recieved by below code:

public void onPurchaseResponse(final PurchaseResponse purchaseResponse) {
    Log.v(TAG, "onPurchaseResponse recieved");
    Log.v(TAG, "PurchaseRequestStatus:" + purchaseResponse.getPurchaseRequestStatus());
}

unfortunately, i always got "PurchaseRequestStatus:INVALID_SKU".

any of you knows how to make this work or do you know a good site for the tutorial?

Also at their site, dialog box should show if I got an INVALID_SKU which I didnt get any.

Était-ce utile?

La solution 2

INVALID_SKU occurs when SKU is not matching or not entered in JSON file. If you are implementing your test app using SDK Tester, then please make sure that the SKU which you are using in your app must have an entry in JSON file too. JSON files resides under /mnt/sdcard/ with name amazon.sdktester.json. Request you to verify whether you have created JSON file with SKU details under this path in the device.

A good approach for managing SKUs would be:

  1. Reference SKUs as strings in your app's strings.xml file -- the same way you would use any string constant.
  2. You can test your app using SDK Tester and the amazon.sdktester.json file without doing anything on the Developer Portal.
  3. When you're ready to submit your app (after testing with SDKTester), make sure you have also submitted your IAP items on the Developer portal -- watch for typos!

We recommend using . for a SKU format, just because it makes it obvious what it is and what app it belongs to. For example:

com.yoyodyne.beachblanketbingo.500_coins

Autres conseils

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

  1. adb install AmazonSDKTester.apk (Install SDKTester on Kindle Fire)
  2. Create a file amazon.sdktester.json in the SDCARD directory (The connected KF shows up as SDCARD in Finder on ur Mac)
  3. Contents of amazon.sdktester.json - { "com.yourcompany.yourpkgname.200_coins" : { "itemType": "CONSUMABLE", "price": 0.99, "title": "200 COINS", "description": "2 COINS", "smallIconUrl": "http://www.yourcompany.com/icon.png" } }
  4. Press the power button on KF & press "Disconnect" button - Now KF is no longer a mounted drive on ur Mac.
  5. Run the AmazonSDKTester app on KF.
  6. Run your app from Eclipse. Make sure the package name in the JSON matches the In App Item package name on Amazon's website & in the PurchasingManager.initiatePurchaseRequest("com.yourcompany.yourpkgname.200_coins");
  7. Now you should see the In App interstitials showing up.
  8. Still doesn't work - Force Close both ur app & AmazonSDKTester on KF; Hard Reset KF ; Restart Eclipse & Restart from Step 1
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top