Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add enableFeedDialog parameter to Facebook button #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arnaudbreton
Copy link

I added a parameter named "enableFeedDialog" to the Facebook button which will open a Feed Dialog (https://developers.facebook.com/docs/reference/dialogs/feed/) instead of open a popup pointing to the sharer.php which is deprecated.

@yuanzhou
Copy link

I was trying out this and got the error says: FB is not defined.

Please notice that app_id and redirect_uri are required.

https://developers.facebook.com/docs/reference/dialogs/feed/

also says "You can also bring up a Feed Dialog by explicitly directing the user to the /dialog/feed endpoint"

see the Direct URL Example

@arnaudbreton
Copy link
Author

FB is not defined because you didn't initialize it before ?
It's strange that you got an error, my test look that FB is defined before calling it.

In my web app with FB initialized all is OK.

You're right about the dialog/feed endpoint but the feed build by the ui method is directly shown in the current page.

Maybe I can open this endpoint if FB is undefined ?

@yuanzhou
Copy link

I just tried to use the link directly and it worked. Check out digg.com and all the FB feed dialog links are using the direct links with a redirect_uri which contains javascript window.close.

@arnaudbreton
Copy link
Author

Ok so I think that I can improve my pull request by adding a parameter to control the way the feed dialog is displayed (FB.ui vs direct link).

As you suggested, we can also add this simple self-closing page.

Are you OK with that ?

@yuanzhou
Copy link

That would be great! I customized mine yesterday and added app_id and redirect_uri for the users to define, so that they don't have to hard code them in the plugin, for example:

buttons: {
    facebook: {
        enableFeedDialog: true,
        app_id: '',
        redirect_uri: 'http://www.yourdomain.com/fbshare_self_colse'
    }
}

There are many other ways to do this, totally up to you.

Happy Xmas!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants