Question

My code is

include_once "fbaccess.php";

  $user_id = $facebook->getUser();
  var_dump($user_id); 
  var_dump($facebook);

Result:-

int(0)       // Why $user_id return zero

object(Facebook)#1 (7) { 
      ["appId":protected]=> string(15) "4545454" 
      ["appSecret":protected]=> string(32) "323232" 
      ["user":protected]=> int(0) 
      ["signedRequest":protected]=> NULL 
      ["state":protected]=> string(32) "c8d6e657da34596785b06e7511921529" 
      ["accessToken":protected]=> string(48) "{APP_SECRET}" 
      ["fileUploadSupport":protected]=> bool(false) }

Please help me. Which thing i have missed????

Was it helpful?

Solution

Have a look at https://developers.facebook.com/docs/php/gettingstarted and stick to the given example. The code you posted is incomplete and will not work like this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top