How to invite users' friends via facebook? - facebook

I'm looking for a simple way for users to be able to invite their friends to follow them on my website.
E.g Bob invites sally to be a follower of Bob on mysite.com.
I was thinking of doing this via requests, however I've read that they only work for canvas apps and not regular websites, meaning if Sally accepted Bob's request, then my website would be loaded as an Iframe within facebook, this would break the layout of my site and won't look good.
Is there any solution, like showing users a link within the canvas which they can click to have canvas turned off and have them sent to my website?
In the facebook TOS it says that a canvas can't exist just for redirecting users, and yet it says that facebook requests should be used for inviting users to your site.
My question is, then what would be the proper way for a website to let their users invite their friends from facebook?

I think that the only way you can do that with facebook is by sending private messages to the invited users which contains the link to your "invite url".
You can use the Send Dialog with the link parameter being the invitation page for your site.
The problem with this method is that you can not control the message that is being sent, you can however put the needed info into the og tags of that link which are added to the message.
Another approach is to use the Chat API where you have complete control over the messages that are being sent.
Problems with this method is that you'll require an extra permission (xmpp_login) and that you'll need to implement a xmpp client.
This is probably an overkill.

Related

Facebook Oauth-enticated users, chat between themselves on website

I have a website where users log in with Facebook. Right now there's no way for users to contact each other.
I was thinking of building a dedicated live messenger with sockets, but I wonder if there's an easier way to allow them to send messages to each other's Facebook Messanger, since they are already logged in with facebook.
There is no API for a chat between two users. Everything in Messenger API is focused on communication between a user and a page.
At most you can use the Send dialog to let a user send a link to their friends, but that requires the user actively using the button, you can not “automate” that; and handling the result will have nothing to do with your site any more, everything after that will happen in messenger only. https://developers.facebook.com/docs/sharing/reference/send-dialog

Can i send direct messages to my clients facebook followers using API?

I have seen services advertising that they can message the followers of pages and accounts on Facebook. I have gone over lots of different Facebook API's and several interesting threads on here but cant find a definitive answer.
Is is possible to directly message via a bot users who like a page providing obviously we have a valid admin token for that page?
Is is possible to directly message via a bot users who like a page
No, that is not possible.
All communication via the Messenger platform API (basis for “bots” in Facebook terminology) requires that the user initiates it.
And it would probably be considered spam by most people - just because I liked your page, does not mean I want to be contacted by you in any way beyond that. Posting to your page is the designated way of communicating with the people that follow your page.

Send app invite request for a website to all friends of user?

I implemented a custom friends selector to send app invite requests for my website to a user's FB friends. But that show no of limitations, first that invitation may be sent to at max 50 people. I have seen games on FB sending app invite requests to user's all friends, wont that same kind of invite work for my website ?
Secondly Using the requests dialog with friend selector, there is no way to select all friends for invite. How could I make it better towards sending app invites to user's all friends ?
At some places in the FB devlopers docs, they mention explicity games & apps on facebook. If I am a website with a FB canvas page as well. Can I use the services availble for games on facebook? (Is it Legal ?)
App requests are for games, not for sharing a website.
The only serious (and not spammy) way to share a website on Facebook is to use the Send or Share Dialogs:
https://developers.facebook.com/docs/sharing/reference/send-dialog
https://developers.facebook.com/docs/web/share
You may want to read this too: https://developers.facebook.com/docs/apps/faq#invite_to_app

Invite Friends Modal for Website off of Facebook

How do you allow your Facebook Connected users to invite their Facebook friends to your website?
All previous answers on SO are outdated referencing that it was previously possible with fb:multi-friend-selector, but since FBML will soon be deprecated, its not an option worth entertaining.
The only option I see now is to create a canvas app that redirects to my website but I would assume this is not permissible since only Canvas or Mobile apps can use the Requests dialog. I could build my own modal by getting the users friends and then sending them a message directly--also probably not permissible.
Nikolay did a fair assessment here, but was not provided a solid answer. Is Facebook locking down multiple friend invites and leaving only newsfeed posts and likes to webpages?
I use Social button like recommend and implement it with my site. ref to https://developers.facebook.com/docs/plugins/
So, we looked and it appears you cannot use the Invite Friends modal unless you are a mobile or Facebook canvas app.
We did, however, come up with a solution. Using the Open Graph API (see Publishing) and the publish_stream extended permission, you can post directly to a user's friend's wall. It cannot be a private message (publish_stream does not allow you to change the privacy of the message) but it does allow user's friend to get a notification of the post.
You can see it working in some of our developer's games on www.pokki.com that are supporting our Pokki Games API. We came up with a nice modal that shows the user what the message they'll be posting looks like. This puts the user in control so they can click on their friend in a list of all their FB friends and makes the message more genuine (rather than automatically spamming all their friends with disingenuous messages).

How can a Facebook Platform website using Facebook's API send invites to a user's friends?

I realize these questions have been asked before on Stackoverflow, but now that FBML is being deprecated, it seems like the answer may have changed.
I have a website that utilizes the Facebook API, which in current terminology I believe makes it a Facebook Platform website. This is now a Facebook Canvas App, which are apps that appear on Facebook itself in iframes.
The Requests Dialog would seem perfect for this, if not for the fact that it's tailored for sending invites for Canvas Apps, and in my case, the Canvas App is simply a blank page assigned to me when I got a Facebook API key. I suppose I could just put a welcome screen and a link on that page for users to click-through, but it's one more click and that much more friction, and a generally hackish approach.
I've found references indicating there was once a way for users to utilize FBML to send an Application Invite, which is not the same as a Request Dialog, such that when a recipient click Accept, they were sent to a URL instead of a Facebook Canvas App. However, as I noted, FBML is in the process of being deprecated.
In light of this, how can a non-Canvas website allow users to send invites to their Facebook friends?
The requests dialog is currently the only supported way. As as alternative you can use the old Facebook REST API to call notifications.sendEmail, which will send the user an email either to their actual email account or their Facebook mail account. That page says that an equivalent graph API method will eventually come to replace this method.
I ended up using the Request Dialog, and hosting on my canvas page a redirect as per:
Redirect User to my Website on a Facebook Canvas Page
Gave the nod still to OffBySome's answer, though, because of his useful information that led me to settle on the Request Dialog.