[CocosJS] Problem Integrate Multi Plugin SDKBox in one Project!

Hi everyone, I integrating 2 plugin: Plugin IAP and Plugin Facebook in my project!

My problem is:

If I init 2 plugin as:

  1. var configJson = {…};
  2. sdkbox.IAP.init(configJson);
  3. sdkbox.PluginFacebook.init();

Project had a error log:E/Facebook(2243): Failed to load config for Facebook
And methods use facebook_sdkbox is not use, with log:
E/Facebook(7263): Facebook plugin haven’t been initialized.

But if I comment line init IAP or reOrder line init Plugin Facebook to the top of the IAP Plugin, error is disappear

  1. sdkbox.PluginFacebook.init();
  2. sdkbox.IAP.init(configJson);
    => OK

In my projectAndroid: res had sdkbox_config.json file: {
“android”: {
“Facebook”: {
“debug”: false
}
},
“ios”: {
“Facebook”: {
“debug”: true
}
}
}
====> Is that problem a bug when integrate multi Plugin in single Project ???
THANKS!

Please don’t use bellow with cocos project, it’s for Unreal engine.

sdkbox.IAP.init(configJson);

just

sdkbox.IAP.init();

@yinjimmy: In file PluginIAPJS.cpp, has method:
bool js_PluginIAPJS_IAP_init(JSContext *cx, uint32_t argc, jsval vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
bool ok = true;
if (argc == 0) {
sdkbox::IAP::init();
args.rval().setUndefined();
return true;
}
if (argc == 1) {
const char
arg0;
std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str();
JSB_PRECONDITION2(ok, cx, false, “js_PluginIAPJS_IAP_init : Error processing arguments”);
sdkbox::IAP::init(arg0);
args.rval().setUndefined();
return true;
}
JS_ReportError(cx, “js_PluginIAPJS_IAP_init : wrong number of arguments”);
return false;
}

It has 2 method init IAP: sdkbox::IAP::init() and sdkbox::IAP::init(arg0);

Yes, it has to two methods. But please don’t using the sdkbox.IAP.init(arg0) api.

@yinjimmy: Thank you! I use sdkbox::IAP::init() and config all Plugin in file sdkbox_config.json and the problem resolved!