“premium” is a non-consumable item on iTunes connect.
After I called “sdkbox.IAP.purchase("premium”)”,
“onSuccess : function (product)” was called.
It’s OK, and I parchased the “premium.”
After I called “sdkbox.IAP.purchase("premium”);”
I called “sdkbox.IAP.restore();”,
and then “onRestoreComplete : function (isResult, msg)” was called,
but “onRestored” was not called.
(isResult was true, and msg was “”, when “onRestoreComplete” was called.)
Currently I can’t restore an item.
How do I restore an item?
◇
(And also,
void onRestored(const sdkbox::Product& info)
is not called
on class IAPWrapperJS”
in PluginIAPJSHelper.h
with using a break point of the debugger.)
◇
I useed a sandbox tester account, and an iPhone device(not simulator.)
cocos2d-x(Javascript) 3.14
SDK BOX V1.0.1.17
◇
————
sdkbox.IAP.setListener({ onSuccess : function (product) { cc.log("onSuccess"); if (product.name == "premium") { cc.log("purchased"); ... } }, onFailure : function (product, msg) { cc.log("onFailure"); ... }, onCanceled : function (product) { cc.log("onCanceled"); ... }, onRestored : function (product) { cc.log("onRestored"); ... } , onProductRequestSuccess : function (products) { cc.log("onProductRequestSuccess"); ... }, onProductRequestFailure : function (msg) { cc.log("onProductRequestFailure error:" + msg); ... },onRestoreComplete : function (isResult, msg) { cc.log("onRestoreComplete isResult:" + isResult + " msg:" + msg); ... } });
———
res/sdkbox_config.json
{ "android": { "iap": { "items": { "premium": { "id": "premium" } }, "key": “…” } }, "ios": { "iap": { "items": { "premium": { "id": "premium" } } } } }