Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The following code works fine for me. You can always email Amazon's support to ask for details about why your IAP failed submission. Also, post your code, then we can see what was missing. You have to make sure IAP is working or exits smoothly when you test on a Kindle and other Android devices (Motorola Droid's, HTC's, etc). </p> <pre><code>private class AmazonPurchasingObserver extends BasePurchasingObserver { public AmazonPurchasingObserver() { super(oThis); } @Override public void onItemDataResponse(ItemDataResponse itemDataResponse) { //Check itemDataResponse.getItemDataRequestStatus(); //Use itemDataResponse to populate catalog data // Didn't use, items have already been stored locally in the game localization xml } @Override public void onPurchaseResponse(PurchaseResponse purchaseResponse) { PurchaseRequestStatus status = purchaseResponse.getPurchaseRequestStatus(); Log.d(sTag, "status: " + status.name()); if (status == PurchaseRequestStatus.SUCCESSFUL) { //If SUCCESSFUL, fulfill content; Receipt purchaseReceipt = purchaseResponse.getReceipt(); String sku = purchaseReceipt.getSku(); successBoughtProduct(sku); // implement the logic you need when a product is successfully bought, ie: increment game scores, save game states, etc. Log.d(sTag, "SUCCESS: " + sku); } else { failToBuyProduct(); // implement your own logic to deal with failures Log.d(sTag, "FAILED purchase"); } } } public static void amazonPurchaseRequest(String productSku) { Log.d(sTag, "amazonPurchaseRequest: " + productSku); PurchasingManager.initiatePurchaseRequest(productSku); } </code></pre> <p>In your AndroidManifest.xml, inside the "application" tag, add:</p> <pre><code>&lt;application ... etc &lt;receiver android:name = "com.amazon.inapp.purchasing.ResponseReceiver" &gt; &lt;intent-filter&gt; &lt;action android:name = "com.amazon.inapp.purchasing.NOTIFY" android:permission = "com.amazon.inapp.purchasing.Permission.NOTIFY" /&gt; &lt;/intent-filter&gt; &lt;/receiver&gt; &lt;/application&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload