How to share High score game on Facebook?

How to share High score game on Facebook?
0.0 0


I’m doing game cocos2d-x, when user get high score, i want them touch on fb icon and share high score on account facebook.

So how to share high score game on Facebook?
Thanks for help


Here’s a link to the page on the official Facebook SDK developer reference website showing how to do exactly what you you mentioned. If you’re not sure how to use the facebook API just search around that page and you’ll find the info. It’s pretty simple.



I’m currently writing a Facebook SDK wrapper for cocos2d-x. It’s basically the iOS and Android SDK wrapped by a CPP singleton.

Right now, I have the following features implemented (for iOS only, at the moment):

  • Logging in to Facebook
  • Get user data such as name, friends, etc.
  • Posting to user’s timeline.

I’m having problems on how to implement these features:

  • Sending/Receiving request (well, I’m already able to send requests but it doesn’t get received)
  • Sending/Receiving challenges

I’m following this guide:
If you could give some info or advise on how to proceed, I would be very thankful.

Thanks in advance.


After i add facebook sdk to my cocos2dx game on ios, it has many errors at:

NSOBJCRUNTIME : Expected unqualified id, unknown type name nsstring



i think because objective-c cannot compile in cocos2dx how to convert it@@


So Anybody help me:(


seems you’re new here :slight_smile:


lance: are you sharing this on github ?

there is this thread about the same topics:


so how to use this link_, no document to guide>_<

Lance Gray, can u share me code


In this link,
i can’t find ObjCalls class, so he don’t up this class:(


franck,Wind Runner: I can’t share the code right now as it is incomplete (very incomplete)

@Wind Runner: In order to do that, you need to implement the Facebook SDK for both iOS and Android and then make an Obj-C wrapper for iOS and JNI wrapper for Android.


Lance Gray : i just want code on ios. but how to make an Obj-C wrapper,have u any tutorial?,j just want to post score(CCSTRING) to timeline facebook, simply:(


Once I finish writing a bit of the Android side, I will upload it on GitHub.

As for implementing Facebook iOS.

  1. Follow the steps in adding the Facebook SDK to your project. Look here: specifically steps 4 and 5.
  2. After that create an Obj-C class and call it “FacebookIOS”. You should now have “FacebookIOS.h” and “
  3. This FacebookIOS class should have a Singleton in it and must be accessible via a static method called “sharedFB”
  4. Use the FriendSmasher sample as base for this FacebookIOS class.
  5. After implementing the Facebook functionalities in Obj-C, you can now create a C++ wrapper. Create a new class and call it FBManagerIOS. You should now have “FBManagerIOS.h” and “
  6. You can turn this class intro a Singleton or just have static methods. Your call.
  7. In it, create methods that will call the singleton’s methods implemented on step 4.
  8. You can now access this Obj-C class in cocos2d-x via the FBManagerIOS class.


Dear Lance Gray,
can you share me code of ios. thank u very much :slight_smile:


Wind Runner, if you are still looking the way to integrate the Facebook in your project then check the plugin developed by me: EziSocial
If you have already found the way then kindly ignore this post.


hi lance_gray!
did you finish demo of this on android? I’m researching in this feature and if you finish this demo for android. pls give link
Thanks in advance!


oh, I’m integrated facebook sdk in my demo. but I just can share a fix link image on the internet. now i need upload the screen shot on the facebook and get image url to post. but I don’t know how to upload image and get url. pls help me! thanks!