question

newuser-fa21156e-caf3-498e-9a9b-263040517e89 avatar image

Cordova IAP plugin doesn't allow to start billing on Android 10 devices

We implemented the IAP feature to distribute an app previously available on Google Play on the Amazon App Store.

The app is produced in Cordova, so we used AmazonIapV2 for Cordova.

We also have Amazon App Tester installed on the device and you can check the JSON files from Amazon App Tester.


・The listener for the purchase event is registered as follows

// Add a listener for the purchaseResponse event.
iapPlugin.addListener("purchaseResponse", purchaseResponse);


・The purchase method is called as follows

// Start the purchase
iapPlugin.purchase(
    function (operationResponse) {
        // operational response
        app.amazon.purchaseRequestId = operationResponse.requestId;
        console.log("Start the purchase");
        console.log("purchase RequestId = " + app.amazon.purchaseRequestId);

    }, function (errorResponse) {
        // error response
        console.log("purchase error response:" + errorResponse);
    },
    [requestOptions]
);


However, on Android 10 devices, the Amazon App Store dialog does not appear when I start the billing process.

On Android 9, 8, 7, and 6, I can start the billing process with no problem and the Amazon App Store dialog is displayed.


If you check the log, the purchase method is handled as shown below, but the purchaseResponse event is not

It has not been called.

On Android 9 and below, the purchaseResponse event is also called.


32654 32654 D SystemWebChromeClient: file:///android_asset/www/js/index.js?ver=2017121905: Line 1335 : Start the purchase
32654 32654 I chromium: [INFO:CONSOLE(1335)] "Start the purchase", source: file:///android_asset/www/js/index.js?ver=2017121905 (1335)
32654 32654 D SystemWebChromeClient: file:///android_asset/www/js/index.js?ver=2017121905: Line 1336 : purchase RequestId = ac36f659-c2ee-4191-9e57-b5051bd556a2
32654 32654 I chromium: [INFO:CONSOLE(1336)] "purchase RequestId = ac36f659-c2ee-4191-9e57-b5051bd556a2", source: file:///android_asset/www/js/index.js?ver=2017121905 (1336)
 1344  3340 I ActivityTaskManager: START u0 {flg=0x18000000 cmp=com.amazon.sdktestclient/.iap.ui.PurchaseActivity (has extras)} from uid 10226
 1344  3340 W ActivityTaskManager: Background activity start [callingPackage: com.amazon.sdktestclient; callingUid: 10226; isCallingUidForeground: false; isCallingUidPersistentSystemProcess: false; realCallingUid: 10226; isRealCallingUidForeground: false; isRealCallingUidPersistentSystemProcess: false; originatingPendingIntent: null; isBgStartWhitelisted: false; intent: Intent { flg=0x18000000 cmp=com.amazon.sdktestclient/.iap.ui.PurchaseActivity (has extras) }; callerApp: ProcessRecord{8de9c44 31243:com.amazon.sdktestclient/u0a226}]

I also ran the IAP SDK sample project I downloaded from this site on Android 10 to try it out.

The purchase process cannot be started and the Amazon App Store dialog is not displayed.

https://developer.amazon.com/ja/docs/in-app-purchasing/iap-get-started.html

The logcat log is the same as above.


We expect this glitch to occur because the AmazonIapV2 side is not compatible with Android 10 and above devices, but

What do I need to do to start the purchase process?

iappurchasing
10 |5000

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

1 Answer

Sheldon@Amazon avatar image
Sheldon@Amazon answered

Hello ,

Thank you for your patience. The team mentioned that they are able to reproduce the issue on Android 11 and Android v10 devices. While they are working on fixing it, For a quick workaround, Please use a device with Android version less than 10.

Regards,

Sheldon

10 |5000

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