Facebook Plugin Share Issues

The lastest SDKBOX Facebook version 2.3.4 has isssues:
Dialog share photo and Dialog share Link always call “onSharedCancel”, although FB share popup show messsage “share successfully”
Please check it and help us. thanks u so much


We’ll test it and let you know.

I’m getting the same problem using the share plugin. Twitter sharing works fine, but facebook sharing returns sdkbox::SocialShareState::SocialShareStateCancelled even when shared successfully.

i use sdkbox-sample-facebook cpp (https://github.com/sdkbox/sdkbox-sample-facebook) to test, but can’t reproduce your issue.

my steps:

  1. update fb plugin by run sdkbox update -p ./cpp

  2. enable Capabilities->Keychain Sharing

  3. compile and run ios

  4. dialog link

  5. check log, work fine

  6. compile and run android by run cocos run -p android -s ./cpp

  7. dialog link

  8. check logcat, work fine

can you guys give me your reproduce steps?
@Pantoo @kwellman

I can reproduce it with the sample on iOS (haven’t tested on Android). It works fine when the facebook app is not installed and sharing is done via a web view, but when the facebook app is installed and the native share dialog pops up it always returns that sharing was cancelled.

Try installing the facebook app on your test device and do a dialog link share again.

fixed, you can try dialog photo/link in next version.
btw, you must have publish permissions before dialog share

1 Like

Great! Thanks for your hard work.

thanks u
and why we have to “2. enable Capabilities->Keychain Sharing”
thanks again

if Capabilities->Keychain Sharing disable, can’t get fb login success event.

I login FB on IOS via my app successfully with Capabilities->Keychain Sharing disable, plz check it!

I believe sharing should work on the device irregardless of whether the Capabilities->Keychain Sharing is enabled or not. It’s only if you’re testing on the simulator that you have to enable it. This is because of a bug introduced to the simulator in XCode 8. I read that it’s fixed in the latest Beta of XCode.


I’m still getting the same error with v2.3.6.1 using the facebook sdkbox sample. I have successfully requested publish permissions and I still get the error.

it’s strange, i try fb v2.3.1.6 plugin on sdkbox-sample-facebook project just now,
dialog share image success, return share success also

can you run sdkbox update -p sdkbox-sample-facebook/cpp again

I have exactly the same problem with my original app using SDKBOX share and facebook plugin. Both versions are v.
The app is for iOS with Cocos2d-x cpp.

Sharing to Twitter seems OK.
Regarding Sharing (link) to Facebook with native Facebook app dialog, it can post the link but callback always “sdkbox::SocialShareState::SocialShareStateCancelled” with share plugin listener and “onSharedCancel()” with facebook listener. response.state is 5 and response.error is none.

The FBSDKLog shows as follows:
“event” : {
“fb_dialog_outcome” : “Completed”,

When I cancel posting using the cancel function of the native share dialog, I have the same callback “sdkbox::SocialShareState::SocialShareStateCancelled” with share plugin listener and “onSharedCancel()” with facebook listener. response.state is 5 and response.error is none.

The log is as follows;
“event” : {
“fb_dialog_outcome” : “Cancelled”,

This is a problem because I would like to process an event only in case the share is succeeded and would not like to do the share success callback event when the share process is cancelled by the user.

By the way the log also shows “plugin com.apple.share.Facebook.post invalidated”.

I hope you can find a solution for this problem soon.

can you show the code about share link to facebook

Hi htlxyz,

Thank you for the reply.

I tried some patterns.

Case 1.
sdkbox::FBShareInfo shareInfo;
shareInfo.type = sdkbox::FBShareType::FB_LINK;
shareInfo.link = shareContent.textUrl;
socialDialogOpened = true;

Case 2.
sdkbox::SocialShareInfo info;
info.link = shareContent.textUrl;
info.platform = sdkbox::SocialPlatform::Platform_Facebook;
info.showDialog = true;


Case 3.
sdkbox::SocialShareInfo info;
info.link = shareContent.textUrl;
info.platform = sdkbox::SocialPlatform::Platform_Facebook;
info.showDialog = true;


Case 1 & 2 resulted the same as the share cancelled (Even successfully posted ! ).
With Case 3 with nativeShare panel (that I do not prefer to), I could get the following success response after sharing.

SharePlugin::onShareState success”

How do you think?

can you get correct event when dialog share image

The code is as follows to share an image.

        sdkbox::FBShareInfo shareInfo;
        shareInfo.type = sdkbox::FBShareType::FB_PHOTO;
        shareInfo.image = _captureFilename;
        socialDialogOpened = true;

The response after sharing was as follows:

SharePlugin::onShareState success

So, now we found the problem was for sharing link.
By the way, when I tried to share a link without dialog, the Facebook SDK blocked the posting and showed a warning dialog.

i tried follows code many times, i can share link succes, and get success result
i use sdkbox-sample-facebook cpp project to test

FBShareInfo info;
    info.type  = FB_LINK;
    info.link  = "http://www.sdkbox.com";
//    info.title = "cocos2d-x";
//    info.text  = "Best Game Engine";
//    info.image = "http://cocos2d-x.org/images/logo.png";

and when you dialog share link, facebook app dialog will popup?
when i dialog share link, web dialog popup, event if fb app installed.