Facebook JSB SDK: not compiling on Cocos2d-X 3

Hi guys,

Partially Solved!

Please see the source code here: https://github.com/CodeBuffet/facebook-jsb-sdk/tree/cocos2dx-jsb-3-compatibllity

I was trying to upgrade a game (for iOS) to cocos2d-x 3 and the Facebook JSB SDK is not working (along with some of my own) anylonger. I get compile errors that JSBool is not defined etc.

My guess is that the binding structure is changed.

I usually use this to create JS Bindings: https://github.com/cocos2d/bindings-generator

My question is: will the FB JSB SDK updated to v3 soon? If not, how can I help? And how can I update my own JSB bindings so they compile again?

Thanks!

Edit: Here is a shot of what I’m looking at right now:

Hi, @peterwilli

JSBool have been changed to bool in 3.0, have you update your bindings generator to the most recent version ? Normally if you use it to generate auto bindings, this shouldn’t happen to you.

Hmm I tried to do git pull yesterday on bindings-generator but it said already up to date.
Then I saw that the master branch was now the develop branch on github, I removed my copy and recloned, now it’s updated. I’ll try again, will let you know if it worked or didnt.

Yep it seems to work! :slight_smile:
I took the oppurtunity to work on a easy project creator for JS bindings: https://github.com/CodeBuffet/bindings-generator/blob/develop/new-binding-project.py

It’s not done yet, but I will continue with it this evening. I got a little sick renaming tests all the time :slight_smile:
Edit: here it is: https://github.com/cocos2d/bindings-generator/pull/99

Just run ‘python new-binding-project.py’ and follow the interactive instructions.

Hi @pandamicro,

I got pretty far making it compatible, please see my source here: https://github.com/CodeBuffet/facebook-jsb-sdk/tree/cocos2dx-jsb-3-compatibllity

The only file that is changed is ‘js_bindings_facebook.cpp’

It is working right now, but there is a crash first time logging in (see screenshot)

Do you (or anyone else) know how to fix that? Thanks!

@peterwilli

Have you solved that? Sorry that I can’t figure out the real problem from the screenshot. But I’m willing to know whether and how you solved it.