IAP mismatch docs vs api Cocos creator 2.0.7

IAP mismatch docs vs api Cocos creator 2.0.7
0

#1

according to docs to initialize IAP we should use

sdkbox.IAP.init();

github examples


use the same

but

in actual code looks like it uses

sdkbox.IAP.init(jsonconfig);

so i have a reference to sdkbox_config.json like this (inside of asset folders on build i manually copy it to res folder)

@property(cc.JsonAsset)
sdkBoxConfigJson=null;
get sdkBoxConfig(){return this.sdkBoxConfigJson.json}

but it crash because

IAP:Failed to get configuration

so how can i call to sdkbox.IAP.init(); without the parameter?


#2

Back to work after Chinese New Year now,

Thanks for your feedback, I check it ASAP.


#3

I checked with bellow code:

        if (cc.sys.isMobile) {
            sdkbox.PluginAdMob.init();


            console.log("sdkbox.firebase.Analytics.Param");
            console.log(sdkbox.firebase.Analytics.Param.kFIRParameterLevel);

            sdkbox.IAP.setDebug(true);
            sdkbox.IAP.setListener({
                onInitialized : function () {
                    console.log("sdkbox.IAP.onInitialized");
                },
            });
            sdkbox.IAP.init();
        }

iOS log:

2019-02-11 16:45:24.997134+0800 hello_world-mobile[85274:46468622] [MC] Reading from private effective user settings.
JS: sdkbox.firebase.Analytics.Param
JS: level
JS: sdkbox.IAP.onInitialized

so, it’s ok to invoke sdkbox.IAP.init();.

plz double check the /Users/admin/ccc207/build/jsb-link/res/sdkbox_config.json file.
Is the file contains iap in android:

https://jsoneditoronline.org/

A bug

I don’t know why, sometimes the sdkbox_config.json is empty after some op.
trying to reproduce this issue.