SDKBOX Facebook Crash

I try to login facebook with sdkbox(2.3.17.1 in cocos creator),but i got crash sometimes。
here is stack:

1 #00 pc 007e51ac /data/app/slots.machine.winning.android-1/lib/arm/libcocos2djs.so (sdkbox::FacebookProxy::logInWithReadPermissions(std::vector<std::string, std::allocator<std::string> > const&, int)+199) [armeabi-v7a]
2 #01 pc 007e6893 /data/app/slots.machine.winning.android-1/lib/arm/libcocos2djs.so (sdkbox::FacebookWrapperEnabled::login(std::vector<std::string, std::allocator<std::string> > const&)+10) [armeabi-v7a]
3 #02 pc 007e72b9 /data/app/slots.machine.winning.android-1/lib/arm/libcocos2djs.so (sdkbox::PluginFacebook::login(std::vector<std::string, std::allocator<std::string> >&)+14) [armeabi-v7a]
4 #03 pc 007b7ca8 /data/app/slots.machine.winning.android-1/lib/arm/libcocos2djs.so (js_PluginFacebookJS_PluginFacebook_login(JSContext*, unsigned int, JS::Value*)+272) [armeabi-v7a]
5 #04 pc 010b0638 /data/app/slots.machine.winning.android-1/lib/arm/libcocos2djs.so [armeabi-v7a]

Thanks for your report, I’ll check https://github.com/sdkbox/sdkbox-sample-facebook with 2.3.17.1 later.

This question is not necessarily triggered, our QA feedback on this issue, I went to the background check that the problem occurred during the log, may be related to the network environment (China’s network is very friendly for Facebook), but you need to do some Defensive coding.

At the same time, I also found that when receiving API callback, non-English characters will appear garbled. I slightly modified the “PluginFacebookJSHelper.cpp” code, so that the return of the data Base64 encoded the following, and then decode the data at the js side. Please also check the following. This garbled problem is in the Creator upgrade after the JS engine appears, do not rule out because of their problems.

I Change code like this:

virtual void onAPI(const std::string& tag, const std::string& jsonData)
    {
        std::string name("onAPI");
        JS::Value dataVal[2];
        
        std::string encodeData;
        //!!!! I DO BASE64 HERE !!!
        Base64::Encode(jsonData, &encodeData);

#if MOZJS_MAJOR_VERSION < 52
        JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET
#endif

        dataVal[0] = SB_STR_TO_JSVAL(s_cx, tag);
        dataVal[1] = SB_STR_TO_JSVAL(s_cx, encodeData);
        invokeDelegate(name, dataVal, 2);
}

1 Like

Thanks for your contribution.

Hello. I have same problem. Workaround in my js code:

data = decodeURIComponent(escape(data));

Also we have a problem with import FacebookPlugin and PluginIAP in android studio.
In proj.android-studio/app/jni need change register of folders facebookplugin and pluginiap to FacebookPlugin and PluginIAP. In Android.mk also need change register:

$(call import-module, ./PluginFacebook)
$(call import-module, ./PluginIAP)

We use ubuntu for developing. Without change register project can’t compile after import sdkbox plugins. Thank You!

ok, it’s case sensitive folder.