Reputation: 1038
I have created an application where i am trying to invite friends via facebook invite friends js method but all working fine but no notification sent to that friend.
My Application Link: http://www.huzoorbux.com/fl/app/android/www/homepage_nopost.html
My Code:
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.api(
"/me/invitable_friends",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
if(top.location != self.location) {
top.location = self.location
}
FB.init({
appId:'228877127299395',
cookie:true,
status:true,
xfbml:true
});
function FacebookInviteFriends()
{
FB.ui({
method: 'apprequests',
message: 'Join My Job Buddy'
});
}
</script>
<a href='#' onclick="FacebookInviteFriends();"><div class="connectbutton5" id="ol">Invite Friends</div></a>
Upvotes: 0
Views: 234
Reputation: 73974
App Requests are for games only, that may be the reason. And always use a callback function for error handling, maybe you are missing an error:
FB.ui({method: 'apprequests',
message: 'YOUR_MESSAGE_HERE'
}, function(response){
console.log(response);
});
Also:
The invitable_friends API is only available for games that have a Facebook Canvas app implementation using version 2.0 of the Graph API.
Source: https://developers.facebook.com/docs/games/invitable-friends/v2.1
If you want to invite someone to a website, use the Send and Share Dialogs and Buttons. You don´t even need to authorize the user for them.
Upvotes: 1