Is it possible to customize the apprequest notification message similar to BranchOut? - facebook

I've noticed that BranchOut requests have a custom notification message and stand apart from other app requests in my notifications.
Is this because BranchOut has a special partnership with Facebook?
The documentation states that the "message" value will not be displayed in the notification, so I'm curious how this is being done.

No it is not possible even with new_style_apprequest parameter in FB.ui options. This used to work earlier but it has stopped working lately. It was anyways an undocumented feature. This is my guess that you might require special permissions from Facebook to be able to achieve this.

it's definitely possible, using the parameter new_style_message set to true - you can double check this by reverse engineering their Javascript API library.
This is a sample code
FB.ui({
display: 'iframe',
method: 'apprequests',
new_style_message: true,
title: "Join my network",
message: "would like you to join his network",
to: [list of user ids to invite]
});

Related

Why does Facebook leadgen ads testing tool give a 102 server error?

I've created a Facebook app, linked it with a business, submitted and passed review, the business is verified, contracts signed, the app has leads_retrieval permission, the app status is now live.
I can test it under the webhooks link in the side menu, my end point receives the test data from Facebook. The data shown below is received by my server.
When I test using the lead ads testing tool I instantly get a 102, server error, and nothing is received by my server. See below for the message.
I've spent so long getting to this stage and every step has been painful!
Can anyone suggest why using the lead ads testing tool results in an error and what I can do to resolve the issue.
Cheers
I've been struggling with this too.. Apparently you can't use it on development apps anymore. Found the answer here: https://stackoverflow.com/a/57397525/8439792
I think I found your problem! It is when you subscribe to your apps. Here is the link that shows the subscribed_fields and scope should be:
https://stackoverflow.com/a/54713182/7313872
I was going straight from the demo and the subscribed_fields is set to 'feeds' and the scope was only manage_pages. You need to change it like in the example in the above link. I will also provide the snippets I changed below:
subscribed_fields - in subscribe apps function
FB.api(
'/' + page_id + '/subscribed_apps',
'post',
{access_token: page_access_token, subscribed_fields: 'leadgen'},
function(response) {
console.log('Successfully subscribed page', response);
}
);
scope - end of facebook login function
{scope: ['manage_pages', 'leads_retrieval']});
Hope this helps!
Facebook had the problem in their startup documentation for the webhooks. I have notified them in a bug, and does look like they have fixed the documentation to now subscribe to "leadgen" and not "feeds".
https://developers.facebook.com/support/bugs/681262475926363/
https://developers.facebook.com/docs/marketing-api/guides/lead-ads/quickstart/webhooks-integration/

Facebook API: Can't have the send dialog working. Why?

I am trying to send a message to a user through private inbox with Phonegap and the phonegap facebook plugin through this functionality:
https://developers.facebook.com/docs/sharing/reference/send-dialog
So when doing this :
FB.ui({
app_id:'XXXXXXXXX',
method: 'send',
name: "This is the name",
link: 'www.google.com',
to:to,
description:'This is the description'
});
as stated in this link : Send private messages to friends
Nothing happen. Why ?
Is it supported by the plugin ?
Please help.
Thanks
I am trying to implement the private message function in phonegap build, but it seems like its only working on desktop not in mobile device.
when I change the method from send to feed, and indicate display to touch.
It works on my IOS build, the window just popup
FB.ui({
app_id:'XXXXXXXXX',
method: 'feed',
link: 'www.google.com',
to:to,
display: touch
});
However, its not working any more when I change the method back to send.
I believe facebook api don't support FB.UI send method in mobile devices, just like what they already mentioned on their page: https://developers.facebook.com/docs/sharing/reference/send-dialog
"This dialog can be used with the JavaScript SDK and by performing a full redirect to a URL. It is not supported on mobile devices."
I STILL DON'T KNOW HOW TO SEND PRIVATE MESSAGE THROUGH FACEBOOK NOW, GOOD LUCK

Facebook Multi Friend Selector (Invite Friends) with Custom Url

I have implemented FB Multi Friend Selector as explained on this page https://developers.facebook.com/docs/reference/dialogs/requests/
function sendRequestViaMultiFriendSelector() {
FB.ui({method: 'apprequests',
message: 'My Great Request'
}, requestCallback);
}
However I want to send the custom Url to the User, since my Facebook App has some parameters at the end like below
http://apps.facebook.com/MY_APP_NAME/MY_PARAMETERS
However with the above method, the user is getting the following link with the MY_PARAMETERS Omitted
I cann't see any "url" parameter in the "apprequests" method. However, this is something that Sweepstakes does successfully. They are able to pass all their parameters in the Message and I want to copy the same functionality.
Thanks in Advance.
The request will point the accepting user to your canvas URL – there is nothing you can change about that.
However, if you need to pass custom data along “with” the request – there’s the data parameter of the dialog for that. You will get the info you put in there back, after reading the details of the request object from the API.

How do I detect if the Facebook Send Dialog is available?

The send dialog is a useful piece of functionality.
Sadly it is not available on mobile devices
I call the api in the following way;
app.sendMessage = function(){
FB.ui({
app_id: app.facebook_app_id,
method: "send",
link: "http://google.com"
});
};
Right now the outcome on a mobile device is a nasty error page.
Is there a way to detect in javascript whether or not the send dialog is available?
I'd suggest something like;
function sendDialogAvailable(){
return FB.supports("senddialog");
}
I could then change my app's functionality according to this property, but right now I fear I'll have to resort to browser sniffing.

Facebook Multiple invites using Requests 2.0

Is it possible to send multiple invites using new Requests 2.0? Documentation as of now saing that 'to' parameter can specify only one user, so it single user or standart request dialog even without possibility to set default filter! It's huge drawback from hidious by nature, but effective in purpose FBML.
Sure.
Look in the docs for Requests 2.0:
Send to Many
From your application front-end,
execute:
FB.ui({method: 'apprequests', message: 'You should learn more about this awesome game.', data: 'tracking data: 'tracking information for the user'});
This will open the facebook Dialog:
If you meant in your question whether or not you can filter multiple id's - meaning, you choose the list of uid's to send the request to and not the user - then the answer is no, it's not possible currently.
Of course.
FB.ui({
method: 'apprequests',
message: 'text for the receiving user',
data: '127', // to know what to do with it.
title: 'title of window.'
});
see this fanpage for an example:
http://www.facebook.com/NeonFashion?sk=app_176086155780033
or i missunderstand your questions and you actual looking for something like
Facebook requests 2.0 filter
It is (now?) possible to open a request dialog targeting multiple users at once, by passing an array of ids in the "to" field.
See the "sendRequestToManyRecipients" example in https://developers.facebook.com/docs/reference/dialogs/requests/