max_recipients > 5 not working on Facebook apprequests (Invite Friends) - javascript

I'm making a invitation system to a project that I'm currently working on. The invitation system allow users to invite a limited number of their Facebook friends to use my project. Let's assume users may have only 20 invitations.
Facebook have a option called max_recipients that limit the number of invitations a user can do. This option is working fine for invitations <= 5, but this is not working for invitations > 5.
In the end of the question you can find my code.
Here limiting invitations in 5:
Here limiting invitations in 20:
Following you can check my code:
window.fbAsyncInit = function() {
FB.init({
appId: "foobarfoobarfoobar",
cookies: true,
xfbml: true
});
}
function FacebookInviteFriends() {
FB.ui({
'method': 'apprequests',
'message': 'A hidden foobar description.',
'max_recipients': '5', // if changed to '20', this stop working.
'title': 'FooBar'
// Callback (insert the invites in database)
}, function(response) {
// If user selected at least one user
if (response.length != 0) {
$.post('<%= invites_path %>', {
request_id: response.request,
to_ids: response.to
}, function(data) {
$('#remaining-invites').text(data);
});
}
});
}
$('#invite').click(function(event) {
fbAsyncInit(); // just for didatic purposes
FacebookInviteFriends();
});
I'm following these two Facebook docs: here and here.
Am I doing something wrong? How I can solve that?

I got a final answer from Facebook:
"Hi Fernando, as it turns out the behavior to hide the counter for max_recipients > 5 was a deliberate product decision, so I am closing this as by design. I am unable to revert your report from confidential to public. Thanks for your patience." (Dave Dosanjh, Facebook Team).
Because I cannot do anything about that and Facebook also don't will make anything about that, I'm answering and giving the best answer to this answer. There's nothing to do, guys :(.

Related

Get UserId of Facebook user

I have a snippet where I allow a user on my MVC Asp.net Site to publish a POST. It works fine.
What I need is when the POST is published and a facebook user clicks on it (There is a url action that takes you to mywebsite if the user clicks on it) . How would I get the userId or something indicating it was clicked by XXXX facebook user?
Once a user on my site publishes this post, a friend may click on the link and I want to know what user clicked on it.
function facebookShare()
{
FB.ui({
method: 'feed',
name: "My gallery - Price: $49.99",
link: "https://mygallery.net/Product/Details/99",
picture: "http://mygallery.com//Images/Products/image.jpg",
description: "In the last 100 years of....",
caption: "Product Name: Awesome Pix-X",
quote:"Quote: You will always be mine!"
},
function (response)
{
if (response && !response.error_message) {
alert('post_id : ' + response.post_id);
} else {
alert('Error while posting.');
}
});
}
So Do I add a query parameter in here to dynamically get facebook user who clicks on it?
link: "https://mygallery.net/Product/Details/99",
If the user did not authorize your App, there is no way to know. If he authorized your App, you can get his id with FB.getLoginStatus, for example.

Facebook social plugin share button

I am using a Facebook social plugin share button, I want to capture the event whether the user shares the event or not.
Is there a way to check whether the user shared it or not using plugin only?
Using the FB.ui method provided by the Facebook JavaScript SDK, you can pass a callback as the second argument and check for the post_id on the response object.
FB.ui({
method: 'feed',
link: 'http://www.example.org/',
picture: 'http://placehold.it/400x400',
caption: 'Title',
description: 'Some description...'
}, function (response) {
if (response.post_id) {
// This post was shared
} else {
// This post was not shared
}
});
More information can be found in the Facebook share documentation.

How can I set a new message for a share dialog on a canvas app?

Using Facebook's JavaScript SDK I am trying to open a share dialog from within a canvas app, which I am able to do fine. However, when I try to amend the message that gets sent along with it, I'm unable to get things working.
I'm aware I can change the message using meta tags within the document itself, as Facebook scrapes the page on the link to grab og:* tags from the head of the doc, but the message I want to share is specific to this user's experience, for example: "I just scores 9/10 on this quiz, can you do any better?".
I have set up an action, object and story, which are being linked in fine. Below is my code, which isn't changing the message:
FB.ui({
method: 'share_open_graph',
action_type: 'the-dog-breed-quiz:take',
action_properties: JSON.stringify({
quiz:'https://apps.facebook.com/removed',
message: 'I scored 15 out of a possible 20 on the Test quiz. Can you do any better?'
})
}, function(response){});
After much searching and piecing things together I have the following solution.
The process is thus:
Have a button to be clicked. This is a must, as you'll need to provide proof of user interaction in order to show a dialog.
Ensure you have publish_actions permission at point of login
Create a user action. I did this using JS SDK, see below code.
Take the ID from the user action and reference that as part of the UI call
.
FB.api(
'me/objects/your-app-namespace:quiz',
'post',
{'object': {
'og:title': 'Blah blah',
'og:type': 'your-app-namespace:quiz',
'og:image': 'https://fbstatic-a.akamaihd.net/images/devsite/attachment_blank.png',
'og:description': 'keyboard mashdfhg nfkg kfd hg',
'fb:app_id': 'removed'
}},
function(response) {
// handle the response
FB.ui({
method: 'share_open_graph',
action_type: 'your-app-namespace:take',
action_properties: JSON.stringify({
quiz:response.id,
})
}, function(response){
console.log(response);
});
}
);

Share on Facebook using Javascript is not working

hi i am using share on facebook using javascript.
When i login to my app for the first time and on facebook from this code for the first time the it works perfect.I am able to share multiple times.
problem starts from here
If i logout from the app and again login then if i click on share button it does not opens popup.
Check my code and correct me if i am wrong somewhere.
Below is my code.
function share(){
var share = {
method: 'feed',
name: 'Real Prize Arcade',
link: 'http://india-webdev.com/arcade/www/RPA.mp4',
picture: 'http://india-webdev.com/arcade/www/images/arcade.png',
description: 'Real Prize Arcade',
source: 'https://www.youtube.com/v/1CE6W5BubQo'
};
FB.ui(share, function(response) {
if(response && response.post_id !== undefined) {
alert('Successfully Shared');
}
});
}

FB ui Allow to share on my wall, friends wall or send by message

I have a page tab and want to allow users to share some content in their wall, friends wall or by a private message to a friend.
I'm currently using:
function postToFeed() {
// calling the API ...
var obj = {
method: 'feed',
link: 'page url',
picture: 'image url',
name: 'Facebook Dialogs',
caption: 'Reference Documentation',
description: 'Using Dialogs to interact with users.'
};
function callback(response) {
document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
}
FB.ui(obj, callback);
}
This works fine but only allows to share in my wall.
So the question is... Is there any dialog or way to allow the three features on the same dialog?
I saw 'send' dialog to send a private message but couldn't find the share on friend wall dialog.
Ideally I wanted to have only a share button and allow the three options after clicking.
Any idea?
Thanks
For the stumblers there isn't a proper official way to do this. However it's still possible to implement it by using the sharer.php technique
https://stackoverflow.com/a/12799020/691553
Cheers
You can use the Feed dialog to share on a friend’s wall, if you provide the to parameter.
To get a userid to send “to” before opening the dialog, you could implement your own friend selector in the way described here: https://developers.facebook.com/docs/guides/games/custom-muti-friend-selector/

Categories

Resources