question

Arlo Leach avatar image
Arlo Leach asked

no callbacks while testing locally with Amazon App Tester

I'm setting up Amazon In-App Purchasing for the first time and am using the version 2 API. I have set up my app in the developer portal, entered the in-app purchases, downloaded the JSON file and installed it into the sdcard directory of my device, and installed the Amazon App Tester app. When I install my app from Android Studio onto a Nexus 10 tablet and run it, my method calls like getUserData() and getPurchaseUpdates() are called, but the corresponding callbacks like onUserDataResponse() and onProductDataResponse() are never called. I did register my IAP class with PurchasingService.registerListener(). It seems that my app is not communicating with the App Tester app. I've followed the instructions on these pages... https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/app-tester-user-guide https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/installing-and-configuring-app-tester https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/test-cases-for-iap But they don't really say how to use the App Tester app. Is there anything special I need to do to make my app communicate with it? Do I need to install or run my app in a special way for local testing? Is there a way to verify that my JSON file is installed correctly (although I suspect that's not the problem since getUserData() doesn't need any data from the JSON file)?
iap
10 |5000

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

Arlo Leach avatar image
Arlo Leach answered
BTW, I did add the manifest code to my app as shown on this page: https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/implementing-iap-2.0 Also, logcat is showing that the PurchasingListener is registered and the In App Purchasing SDK is in Sandbox Mode.
10 |5000

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

Arlo Leach avatar image
Arlo Leach answered
I've been working through this using Live App Testing, and I've gotten as far as retrieving and displaying the list of IAP products in my app, so I can see that the listener and callbacks are set up correctly. Unfortunately, testing through Live App Testing is making my implementation take days instead of hours due to the turnaround time for publishing new binaries. I still get no response from the App Tester app when I try testing my app directly from Android Studio.
10 |5000

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

Jamie Grossman avatar image
Jamie Grossman answered
Hi there, Thanks for posting, and apologies for the delay in response. Sorry to hear you've been having issues with our IAP, but it's good to hear you've managed to get through most of the issues. Live App Testing is usually pretty reliable, but if you've been having some delays, any more information would be appreciated. It might have just been a temporary issue on our side. Regardless, as far as I am aware, you shouldn't need to upload your app to the service to test any new items. You can usually test these locally on the device. Regards, Jamie
10 |5000

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

Arlo Leach avatar image
Arlo Leach answered
I ran into a roadblock with Live App Testing that also has not been resolved. I have a separate thread for that. At this point, I can't get IAP to work with local testing or live app testing, replies to my help requests are taking 2-4 weeks, and the replies I have received haven't contained any solutions, so the prospects of ever distributing my app through Amazon are pretty bleak.
10 |5000

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

Arlo Leach avatar image
Arlo Leach answered
Getting back to the topic of this thread, the Amazon App Tester hasn't done anything at all when I've tried using it. I've followed all the setup steps in the documentation, but that doesn't say how to use it, so there might be other steps I need to take that I'm not aware of.
10 |5000

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

Jamie Grossman avatar image
Jamie Grossman answered
Hi there, I would personally suggest deteting app tester first and trying again. It's hard to say whats going wrong here without more info. Regardless, if you're still running into this, feel free to contact the team directly here: https://developer.amazon.com/appsandservices/support/contact/contact-us If you could also provide an .apk and a log cat from your app, that would be super useful. Thanks, Jamie
10 |5000

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

Arlo Leach avatar image
Arlo Leach answered
All right, nothing changed after reinstalling Amazon App Tester. I still don't know if I need to do something special to set it up, or run my app in a special way. But I've followed all the steps in the documentation, and the default settings in the App Tester app look like they should work, so I left everything at the default. I'll try the email form and will include a link to an APK and logcat since the form doesn't support attachments.
10 |5000

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

Christophe Mogentale (Elokence) avatar image
Christophe Mogentale (Elokence) answered
Hi, Can you give me the answer from Amazon technical support, because I have exactly the same issue ! Thanks. Message was edited by: elokence
10 |5000

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

Jamie Grossman avatar image
Jamie Grossman answered
I have responded to your case.
10 |5000

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

Arlo Leach avatar image
Arlo Leach answered
Based on Jamie's advice (from email), I set up the SampleIAPConsumablesApp from the Amazon SDK download and that worked fine with the App Tester app. So I can now answer some of the questions I asked in my first post: Q: Is there anything special I need to do to make my app communicate with it? A: No, the App Tester app just needs to be installed and running on the device. Q: Do I need to install or run my app in a special way for local testing? A: I don't think so. I didn't install or run the sample app in any special way. Q: Is there a way to verify that my JSON file is installed correctly? A: I don't know, but I don't think my problem relates to the JSON file, because the sample app still communicates with the App Tester app when the json file does not contain the sample SKU. In that case, it returns error statuses as I would expect. So now I can focus on what's different between my app and the sample app, but I haven't found the answer yet. I compared the "receiver" lines in the manifest file and they are identical. I also tried copying the SamplePurchasingListener class from the sample app into my app and using that instead of my own listener class, but I still didn't receive any callbacks. So the problem must occur outside of the listener. I think that this is the minimum code needed to elicit a response from the app tester app: final SamplePurchasingListener purchasingListener = new SamplePurchasingListener(); PurchasingService.registerListener(this.getApplicationContext(), purchasingListener); ArrayList skus = new ArrayList (Arrays.asList("sku1", "sku2", "sku3")); PurchasingService.getProductData(new HashSet (skus)); That's all the sample app does when it launches, and that triggers the onProductDataResponse callback. But in my app, the same code does not trigger the callback. Can anyone tell me what else is missing from my app code?
10 |5000

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