social-share-kit icon indicating copy to clipboard operation
social-share-kit copied to clipboard

Option to use FB.ui share dialog

Open roborourke opened this issue 10 years ago • 3 comments

The share.php was supposed to be retired some time ago. The new way to share content is much better especially on mobile: https://developers.facebook.com/docs/sharing/reference/share-dialog

roborourke avatar Jan 13 '16 12:01 roborourke

I'll try and find time to write this up - do let me know if it's something you'd like to include first though :)

roborourke avatar Jan 13 '16 15:01 roborourke

Just tried changing to new Share dialog. Unfortunately it has app_id param as requirement. So this is not a direct replacement. Probably this feature would be as a solution, in callback you'll be able to change final url if you want: https://github.com/darklow/social-share-kit/issues/41

darklow avatar Mar 17 '16 13:03 darklow

Currently as a workaround you can use:

SocialShareKit.init({
    onBeforeOpen: function (el, provider, paramsObj) {
        if (provider === 'facebook') {
            paramsObj.networkUrl = 'https://www.facebook.com/dialog/share?app_id=' + 
                YOUR_FB_APP_ID + '&display=popup&href=' + paramsObj.shareUrlEncoded();
        }
    }
});

I will think of way to configure it automatically, perhaps if app_id is present in config, I could use new version.

darklow avatar May 13 '16 16:05 darklow