Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send App request to all friends in Facebook using 'Requests Dialog' in Android

I want to know how to send app request to all my facebook friends from android app. I tried in graph API. But, couldn't get it done.

https://graph.facebook.com/apprequests?ids=friend1,friend2&message='Hi'&method=post&access_token=ACCESS_TOKEN

I know this is a Duplicate question. But, couldn't find an answer yet. I'm getting this error on the above API.

"All users in param ids must have accepted TOS."

I hope there will be a way to send app request to all friends from mobile on a click. Please share it.

like image 257
Gugan Avatar asked Jan 16 '13 12:01

Gugan


People also ask

How do you send a friend request on Facebook on Android?

Tap at the top of Facebook and enter your friend's name. Select their name, or tap See more results for [your friend`s name]. If you still can't find your friend, try these steps. To send someone a friend request, tap next to their name.

Where do I find app requests in Facebook?

On the Facebook desktop site, requests appear as a beeper pop-up in the lower left of the screen as well as in the notifications jewel, if they are not filtered. On mobile platforms, requests will surface within the list of notifications in the Facebook App, if they are not filtered.

What is app request on Facebook?

AppRequest. Prompts the someone using your app to send game requests, short messages between users.

What is Facebook Dialog?

The Share dialog gives people the ability to publish an individual story to their timeline, a friend's timeline, a group, or in a private message on Messenger.


1 Answers

The error message you receive ("All users in param ids must have accepted TOS") is because you are trying to send an app generated request to a user who is not connected to your app.

See the developer docs here.

Requests sent with the request dialog and app generated requests are different and you can't use app generated requests to invite users to your app.

Sending Facebook app requests are not available via the graph api. You can use the app requests java-script dialog to send the request though, you would just need to specify the user's id in the "to" property as detailed in the documentation.

Sample function:

<script>
  FB.init({ appId: '**appId**', status: true, cookie: true, xfbml : true });

  function sendRequest(to) {
    FB.ui({method: 'apprequests', to: to, message: 'You should learn more about this awesome site.', data: 'tracking information for the user'});
    return false;
  }
</script>

Then just wire an onclick for each image to something like onclick="return sendRequest('**friendId**');"

Also you can call this function in javascript: It will give you all friends with photos. Also group of friends who are currently using same app. You can send request to any of them.

function sendRequestViaMultiFriendSelector() {
    FB.ui({
        method: 'apprequests',
        message: "You should learn more about this awesome site."
    });     
}

See Facebook Friend Request - Error - 'All users in param ids must have accepted TOS'

like image 136
Somnath Muluk Avatar answered Oct 20 '22 00:10

Somnath Muluk