Skip to content

Instantly share code, notes, and snippets.

@typerandom
Created July 16, 2014 05:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save typerandom/18308e43783e5ade6c5c to your computer and use it in GitHub Desktop.
Save typerandom/18308e43783e5ade6c5c to your computer and use it in GitHub Desktop.
userapp-facebook-find-connection
$client = User::getClient();
$facebook_id = null;
$connection_result = $client->oauth->connection->search(array(
"user_id" => "self"
));
foreach($connection_result->items as $connection){
if($connection->provider_id == 'facebook'){
$facebook_id = $connection->provider_user_id;
break;
}
}
if($facebook_id === null){
echo("Not logged in with Facebook.");
}else{
echo("Logged in with Facebook. ID = " . $facebook_id);
}
@seifip
Copy link

seifip commented Aug 1, 2014

Is it possible to getClient for a specigic user ID?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment