C++ share social SDK

Did anyone know how to share to social for cocos2d-x? For example,sina,Facebook
My game is designed for ios and android,now I want to share to sina,should I add both android sina sdk and ios sina sdk? Is there a social sdk using C++?Please tell me, thank you~

iOS has sharing to Facebook, Sina, and Twitter built in now. Look at Social.framework, it’s really easy to implement. As for Android, I think you can just use the action_send intent. You’ll want something like this:

Intent sharingIntent = new Intent(Intent.ACTION_SEND); sharingIntent.setType("text/plain"); sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, "My message to share"); myActivity.startActivity(Intent.createChooser(sharingIntent, "Share using"));

That’ll pop up a little box and allow the user to choose a sharing app to share with.

I hope that helps!

Ben

1 Like

Ben Ward wrote:

iOS has sharing to Facebook, Sina, and Twitter built in now. Look at Social.framework, it’s really easy to implement. As for Android, I think you can just use the action_send intent. You’ll want something like this:
>
Intent sharingIntent = new Intent(Intent.ACTION_SEND); sharingIntent.setType("text/plain"); sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, "My message to share"); myActivity.startActivity(Intent.createChooser(sharingIntent, "Share using"));
>
That’ll pop up a little box and allow the user to choose a sharing app to share with.
>
I hope that helps!
>
Ben

>Thank you very much~
>Yesterday I used C*+ to package the sina sdk,but it does’t work.
>Today ,I will try social.frameWork.
>Thank you again for your suggestions.
>Jerry
>There is one thing that I want to say,I just need a share sdk using C*+,because I can use it for ios and android…I know that social.frameWork is only for iOS…

You can try sharesdk.cn

Ben Ward wrote:

iOS has sharing to Facebook, Sina, and Twitter built in now. Look at Social.framework, it’s really easy to implement. As for Android, I think you can just use the action_send intent. You’ll want something like this:
>
Intent sharingIntent = new Intent(Intent.ACTION_SEND); sharingIntent.setType("text/plain"); sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, "My message to share"); myActivity.startActivity(Intent.createChooser(sharingIntent, "Share using"));
>
That’ll pop up a little box and allow the user to choose a sharing app to share with.
>
I hope that helps!
>
Ben

Hi, is there a tutorial on how to call these Intent commands from within Cocos2d-x (C++ file)? I’m not sure where to add these commands to make them work through my Cocos2d-x game.

bing cui wrote:

You can try sharesdk.cn

yeah,I know sharesdk,it has two version:ios and android…I need a sdk that using C++…

Thank you for reply…

Matthew J wrote:

Hi, is there a tutorial on how to call these Intent commands from within Cocos2d-x (C*+ file)? I’m not sure where to add these commands to make them work through my Cocos2d-x game.
The Intent commands are Java calls, which you’ll need to put in a .java file. There’s a system in place called JNI, which Cocos2d-x uses extensively, to communicate between C*+ and Java. You basically need to make a special type of function call from within C++ to talk to Java, and name your receiving functions in a special way to go the other way (from Java->C++). There’s lots of information on Google about JNI, and there are many examples of it working within the Cocos2d-x samples.

Hope that helps!

Ben

Hi,are you solved it now?