Hi,
I only using SDKBOX IAP with Cocos2d-JS v3.8.1.
Crash happen in PluginIAPJSHelper.cpp
void callback(float dt) {
if (!s_cx) {
return;
}
JSContext* cx = s_cx;
const char* func_name = _eventName.data();
JS::RootedObject obj(cx, _jsHandler);
JSAutoCompartment ac(cx, obj); <-- crash on this line
I setup IAP with a global function in a scene1. Crash happen when changing scene from scene2 to scene1.
However, the crash is not always.
function setupIAP()
{
sdkbox.IAP.init();
sdkbox.IAP.setListener(
{
onSuccess : function (product)
{
},
onFailure : function (product, msg)
{
},
onCanceled : function (product)
{
},
onRestored : function (product)
{
},
onProductRequestSuccess : function (products)
{
},
onProductRequestFailure : function (msg)
{
}
});
sdkbox.IAP.refresh();
}
Any idea on the crash?
Thank you.