BillingClient is null or not ready

I integrated payment step by step of the following guide https://docs.sdkbox.com/en/plugins/iap/v3-cpp/. When I call sdkbox.IAP.refresh(), I get error when implement IAP com.asiuniversal.kitchenworld W/SDKBoxIABBillingClient: billingClient is null or not ready and do not get event onProductRequestSuccess or onProductRequestFailure

  • Cocos2d-js 3.17
  • IAP plugin 2.6.0.1

Init sdkbox and listen event:

sdkbox.IAP.init();
cc.log(“SDKBOX init”);
sdkbox.IAP.setDebug(true);
sdkbox.IAP.setListener({
onSuccess: function (product) {
//Purchase success
cc.log("SDKBOX Purchase successful: " + product.name);
},
onFailure: function (product, msg) {
//Purchase failed, msg is the error message
cc.log("SDKBOX Purchase failed: " + product.name + " error: " + msg);
},
onCanceled: function (product) {
//Purchase was canceled by user
cc.log(“SDKBOX Purchase canceled: " + product.name);
},
onRestored: function (product) {
//Purchase restored
cc.log(“SDKBOX Restored: " + product.name);
},
onProductRequestSuccess: function (products) {
cc.log(“SDKBOX RequestSuccess: " + products.length);
},
onProductRequestFailure: function (msg) {
//When product refresh request fails.
cc.log(“SDKBOX Failed to get products”);
},
onShouldAddStorePayment: function (productId) {
cc.log(“SDKBOX onShouldAddStorePayment:” + productId);
return true;
},
onFetchStorePromotionOrder: function (productIds, error) {
cc.log(“SDKBOX onFetchStorePromotionOrder:” + " " + " e:” + error);
},
onFetchStorePromotionVisibility: function (productId, visibility, error) {
cc.log(“SDKBOX onFetchStorePromotionVisibility:” + productId + " v:” + visibility + " e:” + error);
},
onUpdateStorePromotionOrder: function (error) {
cc.log(“SDKBOX onUpdateStorePromotionOrder:” + error);
},
onUpdateStorePromotionVisibility: function (error) {
cc.log(“SDKBOX onUpdateStorePromotionVisibility:” + error);
}
});

Logcat:

2020-05-04 16:47:02.753 6209-6256/com.asiuniversal.kitchenworld D/cocos2d-x debug info: SDKBOX init
2020-05-04 16:47:02.753 6209-6256/com.asiuniversal.kitchenworld D/IAP: Refreshing products: ‘com.asiuniversal.kitchenworld.android.starterpack’
2020-05-04 16:47:02.753 6209-6256/com.asiuniversal.kitchenworld W/SDKBoxIABBillingClient: billingClient is null or not ready

The same problem. @yinjimmy Can you take a look at us?

Hi @john_daniel, I have resolved this issues. You can search your issues by key word SDKBoxIABBillingClient look at message “onBillingSetupFinished: responseCode=?”. My responseCode=3 because I tested on the emulator and not sign in Google Play.

1 Like

Wonderful. You save my time. Thanks.

  • @htlxyz can add this message on FAQ