Open bearkids opened 10 years ago
you need to add the code in AppDelegate.cpp
sc->addRegisterCallback(register_all_pluginx_protocols);
sc->addRegisterCallback(register_pluginx_js_extensions);
There is a sample in the samples/js-tests/project/Classes/AppDelegate.cpp
Thanks @jianglong0156
It seems those 2 callback cannot place after sc->addRegisterCallback(JavascriptJavaBridge::_js_register);
It works fine now if I pack my program into APK.
But it shows "facebook.isLoggedIn is not a function" if I debug with android ADB Mode in Cocos Code IDE.
Thanks again.
The function isLoggedIn defined in file "jsb_pluginx.js".
It usually in your project proj.android/assets,
If you not find it,
You can use the Cocos console try again
Yes, jsb_pluginx.js is located in proj.android/assets. I can also successfully pack the app into APK and login facebook from my app.
But if I debug my app with android ADB Mode in Cocos Code IDE, it shows "facebook.isLoggedIn is not a function". It seems Cocos Code IDE cannot be used to debug facebook SDK function.
I am using cocos2d-js-v3.0 final and cocos code ide rc2.
I followed the following guide http://cocos2d-x.org/docs/manual/framework/html5/facebook-sdk/facebook-sdk-on-android/en http://cocos2d-x.org/docs/manual/framework/html5/facebook-sdk/api-reference/zh
I can successful built the APK but whenever I call facebook function, it shows "plugin is not defined".
Really strange, any idea?