question

appstroid7 avatar image
appstroid7 asked

IAP 2.0 sample app Android demo not working

Hello there,

I really need to implement IAP 2.0 in my android app, for that first I downloaded Amazon-Android-SDKs.zip & import sample consumable app to android studio from there. then run the project & install apk file in mobile device as per given guideline here,

Get Started with IAP

after that configure & Install App tester app from amazon app store & set given amazon.sdktester.json file in device root folder. which showing json data properly under IAP items in JSON File tab in app tester.

Install and Configure the App Tester

but when I am going to test in-app purchase in Sandbox mode from sample app, there just getting below response & can't show any transaction under manage transaction in App tester.

 In App Purchasing SDK - Sandbox Mode: sendPurchaseRequest  D/SampleIAPConsumablesApp: onBuyOrangeClick: requestId (12648ebb-19ac-4a6e-8497-df94ea9a38e7)


I am using Android 10 device for testing,
can you tell me where is the mistake from my side in configuration or Is there issue in IAP 2.0 sample app & app tester or android 10 (means android new versions)?

Please help here to fix this.

iapandroidcommunity feedback
10 |3000 characters needed characters left characters exceeded

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

Sheldon@Amazon avatar image
Sheldon@Amazon answered

Hello ,

Thank you for contacting us on forums.

While using the application from IDE it will be in Sandbox mode. In Sandbox mode, application does not connect to Amazon server but instead uses IAP items from the JSON file and thus the warning you are observing is expected.

As mentioned in the following link: https://developer.amazon.com/docs/in-app-purchasing/iap-testing-overview.html#iap-test-modes

If you are using a sandbox mode, you should configure the AppTester: https://developer.amazon.com/docs/in-app-purchasing/iap-install-and-configure-app-tester.html

Regards,

Sheldon

10 |3000 characters needed characters left characters exceeded

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

NewUser-d551e800-b567-4fd3-95db-410c771e7725 avatar image
NewUser-d551e800-b567-4fd3-95db-410c771e7725 answered

I've tested the sample app on Android 10/11 emulators. And it works on Android 10 but not Android 11. Although I clicked the 'Buy Orange' button, the purchase popup didn't appear.

When I added the following code in AndroidManifest.xml(ref), it seems like working on Android 11. I can show the purchase popup and click 'Get Item' button but the orange count is not updated, always 0.

<uses-permission
    android:name="android.permission.QUERY_ALL_PACKAGES"
    tools:ignore="QueryAllPackagesPermission" />


10 |3000 characters needed characters left characters exceeded

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