68060
68060

Reputation: 427

Amazon IAP Android onProductDataResponse always fails

I am trying to implement a simple subscription IAP on Android using the Amazon SDK. I adjusted their subscription sample app. The code is really simple.

Set <String>productSkus =  new HashSet<String>();
productSkus.add("TLS_SKU_MONTHLY" );
productSkus.add( "TLS_SKU" );
PurchasingService.getProductData(productSkus); 

But the response from onProductDataResponse() is always fail. I'm not sure why, I cannot find any examples etc to even know if my SKUs are right, in the sample app they looked more like package names than this, but these strings are what I entered on the 'in-app items' on the apps page on Amazon. The app has not been submitted yet, but I need to test and implement IAP before that. Any ideas? I cannot even find a simple tutorial walking through this, and as usual their docs are poor.

edit, noticed im getting these errors that dont even come up on google

Kiwi: DataAuthenticationKeyLoaderV3: Unable to load authentication Key
    java.io.FileNotFoundException: AppstoreAuthenticationKey.pem

DATA_AUTH_KEY_LOAD_FAILURE: CERT_NOT_FOUND: null
    com.amazon.a.a.o.b.a.a: DATA_AUTH_KEY_LOAD_FAILURE: CERT_NOT_FOUND: null

I'm wondering, is this because I am running on real Android and not an Amazon device like a fire tablet or tv stick?

Upvotes: 0

Views: 1083

Answers (1)

Andrey Vershadov
Andrey Vershadov

Reputation: 51

You should add your own AppstoreAuthenticationKey.pem to the project assets folder. It is not (and should not be) delivered together with the sample.

Basically, you must do a few things:

  1. Login to the Amazon developer console and create your application.
  2. Go to the “Apk Files" tab to download AppstoreAuthenticationKey.pem.
  3. Add this file to the project’s assets folder.

You can get the full instructions from Amazon.

As for devices, yes, you must use an Amazon device. But this should not be the reason why you are getting this exception.

Upvotes: 4

Related Questions