Facebook request dialog with custom messages like Branchout - facebook

How does Branchout custom their Request Dialog messages? There is no option for this.
The documentation https://developers.facebook.com/docs/reference/dialogs/requests/ doest mention any extra parameters, only app_id, redirect_uri, message ,to , filters , exclude_ids , max_recipients, data, title.
As im a new user, i cant post images.. Here are the links: http://i.imgur.com/37tju.png ,
Im using the following javascript to call the facebook function:
FB.ui({
method : 'apprequests',
message : 'Message itself',
title : 'Title message',
display : 'iframe',
access_token : '(access_token)',
to : uids
}, function(response) {
if (response)
{
// handle callback.....
// (...)
}
});

There are some APIs with special privileges. You have to get a way of get in touch with Facebook. I don't know any docs for it.

there is no need to have special partnership to do such a thing.
Please check Is it possible to customize the apprequest notification message similar to BranchOut?

Related

how to post on multiple facebook friends wall using Facebook api FB.UI

how can post on my facebook friends wall using FB.UI
my code is
FB.ui({
method: 'feed',
link: 'https://developers.facebook.com/docs/',
to:['405631902932995,626150064162274'],
caption: 'An example caption'
}, function (response) {
console.log(response);
});
i am getting error like
API Error Code: 100
API Error Description: Invalid parameter
Error Message: ["100004585663846,100003018593104"] does not resolve to a valid user ID
That parameter only allows to enter one ID, not an array of them. Meaning, what you want to achieve is not possible at all, you can only specify one friend.
https://developers.facebook.com/docs/sharing/reference/feed-dialog/
You can also use the Send Dialog to send a message to a friend: https://developers.facebook.com/docs/sharing/reference/send-dialog
The same applies to the "to" parameter, you can only specify one recipient.

How to Display success message after Request sent using facebook dialog?

I have an app on facebook. I can send request OR post to feed on share but I am facing problem after sending request.
I want to display success message. Something like your requests has been sent.
Actually if I talk more specifically, I need code to display success message (requestCallback code required) after sending request from facebook dialog.
I am working on my facebook game application: http://apps.facebook.com/siegiusarena
Any reference link OR code for requestCallback handler would help.
FB.ui({ method: 'apprequests',
title: 'Title',
message: 'Message'
},
function (res) {
if (res && res.request) {
// do something if the request was created
alert('your requests has been sent');
// or maybe something like that
$('#messagecontainer').text('your requests has been sent');
}
else if (!res) {
// do something if the request was not created
}
});
EDIT:
If you want to show dialog with success message that simply looks the same as FB dialogs there are 2 ways:
1) You can use library/plugin that is designed to do this, like Facebox - http://defunkt.io/facebox/
2) You can style, for example, jQuery UI dialog on your own to achieve that, something like that - http://www.neilyoungcv.com/blog/code-share/emulating-facebooks-dialogue-using-jquery-ui-dialogues/

Javascript SDK Multi friend selector

I'm trying to install the fb multi friend selector using javascript SDK following this link :
http://developers.facebook.com/docs/reference/dialogs/requests/
My question is : when i call the function :
function sendRequestViaMultiFriendSelector() {
FB.ui({method: 'apprequests',
message: 'My Great Request'
}, requestCallback);
}
Its open a pop up with all my friend and send a message but when i go to Facebook and open this notification it open a wrong url :
http://mydomain.com/?request_ids=448697108486876&ref=notif&app_request_type=user_to_user
So i wanted to know if it was possible to open a friend selector pop up and send a private message or a simple message on the wall to all friend users ? There is an existing code for that ? or i must develop my own code with Javascript SDK ?
Thanks you.
Yes, you can use the send dialog, if you had a multi friend selector and then the callback sent the array of selected friends to another function then you can call th send dialog, and put the callbacked users into the "to" field:
function sender(users_array) {
FB.ui({
method: 'send',
name: 'Name',
to: users_array,
link: '<Some_URL>',
});
}
https://developers.facebook.com/docs/reference/dialogs/send/

Facebook AppRequests redirect user to a Page Tab

When sending an AppRequest using from a page Tab:
FB.ui({
method : 'apprequests',
message : 'message',
title : 'Friend'
}, function (response){}));
I want the receiving user to be directed to the page tab and not the canvas application page.
is there a redirect_uri parameter that's no documented or should I just do a hard refresh on the canvas?
Also would like to know if I can force the user to select only one friend in this dialog in used to be possible in the old requests widget?
Thoughts appreciated
If a user clicks 'Accept' on a Request, they will be sent to the Canvas Page URL of the app that sent the Request. This URL will contain an additional GET parameter request_ids, which is a comma delimited list of Request IDs that a user is trying to act upon:
https://apps.facebook.com/[app_name]/?request_ids=[request_ids]
You can the redirect to the fan page tab.
Atul Agrawal, Founder, ascratech.com
I've done this by setting up a requestCallback method, a JavaScript method that gets called after completing the dialogue.
FB.ui({method: 'apprequests',
message: 'Requests are fun.',
display: 'iframe',
access_token: ACCESS_TOKEN,
}, requestCallback);
function requestCallback(response) {
// Handle callback here
window.location = "URL_FOR_RESPONSE_ACTION";
}

Facebook API: Suggest page to friends and view which are were selected

I am developing an application which is based on user challenges. The app also requires a Facebook account to play.
I want a user to be able to select a bunch of friends he wants to challenge and send them an "invitation". But besides this, I need to find which friends did the user invite in order to save them to my database and "prepare" the challenge.
I managed to do the select-friends-dialog using this, but have no idea how to retrieve the selected users. Also, does this work on non-canvas Facebook applications? As I read that page, I am not sure whether it will work for my non-canvas application.
Here is my select-friends-dialog code:
function challengeFriends(){
FB.ui({
method: 'apprequests',
message: 'message",
title: 'title'
});
}
Any help is highly appreciated! Thank you.
I've written a tutorial that covers what you are asking for and other aspects of the Request dialog: How To: Send An Application Request Using The Facebook Graph API
The idea is to capture the request ids from the callback and save them in your DB, and within the request itself you can find the invitee id (friend id):
FB.ui({
method: 'apprequests',
message: 'Check out this application!',
title: 'Send your friends an application request',
},
function (response) {
if (response && response.request_ids) {
var requests = response.request_ids.join(',');
$.post('handle_requests.php',{uid: <?php echo $uid; ?>, request_ids: requests},function(resp) {
});
} else {
alert('canceled');
}
});