[NEED HELP] twitter share - why onShareState: SocialShareStateCancelled called right after SocialShareStateBegin

After just create an app on twitter to get key and screte.
and follow the introduction of http://docs.sdkbox.com/en/plugins/share/v3-cpp/

    sdkbox::SocialShareInfo info;
    info.text = "#sdkbox(www.sdkbox.com) - the cure for sdk fatigue ";
    info.title = "sdkbox";
    //info.image = "path/to/image"
    info.link = "http://www.sdkbox.com";
    info.showDialog = true; //if you want share with dialog,set the value true
    info.platform = sdkbox::SocialPlatform::Platform_Twitter;

I just received SocialShareStateCancelled called right after SocialShareStateBegin (with .showDialog = true)
But if I set info.showDialog = false; I get SocialShareStateFail with “user authenticate fail” after SocialShareStateBegin.

ps: in Android studio, it crash at the after

(sdkbox::ShareWrapperEnabled::nativeInit(sdkbox::Json const&)+100)
(sdkbox::ShareWrapperEnabled::init(char const*)+110)

Some one can help me what I have to do more to fix this problem.
Thanks for all.

  1. get Cancelled, maybe you haven’t login twitter on iOS.

  2. android crash? show show a more detail crash log?

Thank you for your reply.

If I haven’t login twitter, in this case I think when call sdkbox::PluginShare::share(info) and the sdkbox should show the dialog for login. if Not, how can I show that dialog ? I could not found any thing about “the way of login” in document.
Please help me.

I install twitter into iphone, after login with app twitter (login twitter with twitter web in safari had no effect).
Now I can share twitter successfull.
But, I can not change the user for share. logout twiter, login with another user, cocos2d app still share with the old user (the first connect my app with twitter).

Remove twiter app, remove my app -> re-install my app => my app still share with the old one ???

  1. if you not login, twitter will try show login dialog, return "user authenticate fail” when login failed, we will send more detail error in next version.

  2. when you login twitter, TwitterKit will get current user session, but you logout/reinstall, this will not affect TwitterKit session, so, still use old account. how about we provide a logoutTwitter api to clean TwitterKit session


can you try this, we add a new api logoutTwitter;
and if you login failed, checkout log, you can get a detail error.

Thank you for your reply.
I will try and let you known the result later.

now I am trying on android and got these issue:

  • it not share with image

  • it not callback the onShareState except the SocialShareStateFail.

call sdkbox::PluginShare::logoutTwitter();
call sdkbox::Share(info) => still using the old account :frowning:

  1. logoutTwitter does not work, my fault, forgot something when package

  2. android, testing, will update when finish test.


android: i can share sucess on android. directly share is not support image on android.