question

zengotim avatar image
zengotim asked

amazn_wa.IAP is null in Amazon tester log

Hi,

Our web app works fine using the sandbox testing environment, however we cannot get published due to the app failing testing procedures. The line which shows up in the logcat file from Amazon's tester indicated that the initial test of:

document.addEventListener("amazonPlatformReady", function() {

if (amzn_wa.IAP == null) {         
    console.log("Amazon In-App-Purchasing only works with Apps from the Appstore");
} else { ...

is coming back true., ie: amzn_wa.IAP is indeed null. There is no indication in the log of errors which would cause the IAP API not to load, nor can we find an issue like this here on the forum or in a web search. Again: the app works fine in sandbox environment. Any assistance would be greatly appreciated!

iapapp submission and updatesweb apps
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Levon@Amazon avatar image
Levon@Amazon answered

Hi zengotim,

Thanks for posting! Have you created all of your IAP items in Dev Portal, and submitted them (are they all showing their status as "Live")? I would strongly suggest creating a test in the Live App Testing service, and testing your app in that environment before submitting it. That way you will be able to get more insight as to how it's behaving in live environment. Thanks!

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

zengotim avatar image
zengotim answered

Hi Levon and thank you very much for your swift response. Yes, our subscription items are submitted and listed with status "Live" in the dev portal, the current version of the app (no IAP) is, and has been, Live, and we are attempting to submit this version as an upcoming version. The decision to submit for testing prior to submitting as an upcoming version is not mine and is being made based on many factors outside of my control. The app works perfectly in the sandbox environment, the JSON used in the sandbox environment was generated by submission of the subscription items in the dev portal, and we have reviewed the testing logs, screenshots, and videos extensively. Again, any assistance would be greatly appreciated, thank you!

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Levon@Amazon avatar image
Levon@Amazon answered

Hi zengotim,

Thanks for additional details. Have you registered your listener correctly, as in this sample code:

https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/iap-entitlements-webapps

please try to copy this sample code and ensure it works correctly for you. As I mentioned earlier, I would still suggest you to upload your app to Live App Testing service, so you can test it in a live environment, similar to that of a public release.

Alternatively, if you are using Cordova, please refer to this article:

https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/using-the-iap-plugin-for-cordova

If you still require assistance with this, please login to your Dev Portal account, and use Contact Us, specifying your app name / ID, and we will investigate. Thanks!

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

zengotim avatar image
zengotim answered

Hi Levon,

Thank you for your response. The listener for the 'amazonPlatformReady' is indeed registered correctly, and matches Amazon's example code almost exactly:

function initialize() {
    loadPageState(); 
    amzn_wa.enableApiTester(amzn_wa_tester); 
    refreshPageState(); 
    document.addEventListener("amazonPlatformReady", function() { 
        if (amzn_wa.IAP == null) { 
            console.log("Amazon In-App-Purchasing only works with Apps from the Appstore"); 
        } else {
                

The tester's logcat file and the screenshots show that the console message above, in the condition amzn_wa.IAP == null is being sent. As you suggested, we have used the 'contact Us' form to request help in this matter a week ago, but have not heard back from anyone at all. We did re-submit the app and this time received slightly different results: 5 devices were tested, and 2 of them passed. The two that passed were Fire tablets while the three that failed were Fire TV devices, all failing in the above manner. I don't know how this could be related as this is a pure web app so all devices are running the same scripts, but perhaps someone there at Amazon has some insight given this new information?

Thanks in advance, and thank you for having always responded to our pleas for help!

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Levon@Amazon avatar image
Levon@Amazon answered

Hi zengotim,

Hopefully you have figured out the issue. If not, then it looks like you are missing the Amazon webapps API javascript.

https://developer.amazon.com/public/solutions/platforms/webapps/docs/environment.html -- as mentioned here please invoke the javascript to get the IAP API working.

Please let us know if you need further assistance. Thanks!

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.