how to get facebook apprequest receiver user id
<a onclick="facebook_invitess_users(); return false;" href="#" class="link2">click here</a>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({appId: 'your_appid', status: true, cookie: true, xfbml: true});
};
FB.init({appId: 'your_appid', status: true, cookie: true, xfbml: true});
var facebook_invitess_users = function() {
FB.ui(
{
method: 'apprequests',
message: rebuild,
data: 'tracking information for the user',
title: 'Choose the friends you would like to invite',
},
function(response) {
jQuery.post(
"submit_url",
{request_ids: response.request_ids},
function(data) { alert(data); },
"html"
);
}
);
}
</script>
submit url php file code
<?php
if(isset($_REQUEST['request_ids'])) {
$sent = $_REQUEST['request_ids']; //Convert csv to array
$count = count($sent); //count how many objects in array
$appid = 'facebook_app_id';
$secret = 'facebook_app_secrct';
$app_token = file_get_contents('https://graph.facebook.com/oauth/access_token?client_id='.$appid.'&client_secret='.$secret.'&grant_type=client_credentials');
//Get application token
for ($a = 0; $a < $count; $a++) {
$request = file_get_contents('https://graph.facebook.com/'.$sent[$a].'?'.$app_token);
print_r($request); // This will output like below
$arr = json_decode($request);
var_dump($arr);
print_r($arr->to->name);
print_r($arr->to->id);
}
}
?>
Freelance Web Programmer, Android, Php 5, java, MySql, JQuery, Symfony framework, Smarty template, facebook application, googlemap application
Subscribe to:
Post Comments (Atom)
how to see xml preview in browser php
xml preview view in browser $xml = new DOMDocument('1.0', 'UTF-8'); $xml->preserveWhiteSpace = false; ...
-
Weather In Summer: 33.8 C (Max) - 23.3 C (Min) In winter: 20.3 C (Max) - 0 C (Min) Rainy Season : from July to Mid Sept, and very humid (Upt...
-
go to In httpd.conf add comment bellow line userdir disabled ----------------------------------------------- chmod 711 for /home/userdir(use...
-
The contents of my /etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX=permissive # enforcing - ...
No comments:
Post a Comment