Send Friend Request from my website - facebook

I want that i have a business portal any one enter in my portal get a send friend request button with in my website when the user of my website click the button automatically send the friend request to me. It can be possible?
give me some code on java script

Related

Send Button Template in Facebook Messenger Platform: web_url Button Clicked Event

I am developing on the Facebook Messenger Platform, the documentation shows that when I am sending a button template, I can specify the button type to be web_url, which, when clicked by the user, takes user to a webpage in the built-in browser of the messenger.
My question is: is there any way for my application server (postback server) to know if a user clicks a web_url button? E.g. as a postback server call? Thank you!
I think your best option is to proxy that URL through your application server and then redirect to the real URL so that you can detect if the user navigated to that link.
You'll also want to detect the UserAgent for the "facebook bot" as Facebook will try to scrape your URL first (even if the user doesn't click it).
So say you want to point your user to:
https://foo.com
You'll want to setup an endpoint on your application server:
https://{your-application-server}/url_click?url=https%3A%2F%2Ffoo.com&id=XYZ
url is the urlencoded url they'll end up
id is some id that you can identify that facebook messenger user session with
You can then use that information to lookup the Messenger session with that id and perform a click handling callback.
You'll want to detect the UserAgent is a browser and not the "facebook bot"
https://developers.facebook.com/docs/sharing/webmasters/crawler

Have a "apprequests" notification redirect to a website

I have the FB request dialog (http://developers.facebook.com/docs/reference/dialogs/requests/) setup so my users can invite friends. Everything is working fine, it sends a notification to the user(s) and all, but I want to have it so that when the recipient clicks the notification or 'jewel' it takes them to my website instead of a FB page/app.
At the moment it's not possible to set the redirect uri on a request. The only way to do this is to have a js redirect on you application canvas.
top.location.href='YOUR_SITE'

Facebook: Invite to application without using Facebook's dialogue box

I have made a custom invite screen in my Flash application, when the send button is clicked I want all the selected facebook Ids to be sent, ideally without a dialogue window popping up.
Cheers.
User to user app requests must use the requests dialog
App to user requests can be sent via the app access token but can only be sent to existing app users and are not displayed the same way on Facebook.com
You can specify an ids parameter to the requests dialog when firing it to show only the users selected earlier in the workflow if you wish

Request for Permission box does not appear when user accepts my application

My facebook friend cannot successfully accept my application.
I created an application in facebook. When I invite a friend to my application the following happens:
1 - My friends receives an invite to my app.
2 - In my friend's page he is given a choice to either "accept" or hit "x" to decline.
3 - When my friend hits the "accept" button, the request disappears. the application is not added in his list of applications and he is not taken to the "Request for Permission" box.
When we checked his privacy settings, my application was not listed as an application he allowed permission to, even though he accept the application.
Why is this so?
The invite happens on my website with this call:
FB.ui({method: 'apprequests',filters: ['app_non_users'],
message: 'You should learn more about this awesome game.',
data: 'tracking information for the user'});
I copied this from the FB site: http://developers.facebook.com/docs/reference/dialogs/requests/
Thanks.
I ended up using an intermediate page which sent a request permission call to facebook.

Facebook Send - How to find out who message recipients are

I'm building a site that I've integrated with FB Send. Is there any callback that will tell me who the messages were sent to if a user on my site uses FB Send?
At this time there is no callback from Facebook for the FB Send button you referenced. There is not currently any way to retrieve the list of recipients for which a user has just messaged via send button, sorry.