How to get the user email address in Facebook (Facebook Connect or Graph API)?

后端 未结 3 966
逝去的感伤
逝去的感伤 2021-01-20 02:30

I previously have an FBML application in Facebook and now change to an IFrame application in FB, using the graph API. (under the same name, same game account. Just switch f

3条回答
  •  旧时难觅i
    2021-01-20 02:42

        You can get  user email address and details in Facebook (Facebook Connect or Graph API)
     '344617158898614',
      'secret' => '6dc8ac871858b34798bc2488200e503d',
    ));
    
    // See if there is a user from a cookie
    $user = $facebook->getUser();
    
    if ($user) {
      try {
        // Proceed knowing you have a logged in user who's authenticated.
        $user_profile = $facebook->api('/me');
      } catch (FacebookApiException $e) {
          echo "FacebookApiException";
        echo '
    '.htmlspecialchars(print_r($e, true)).'
    '; $user = null; } } ?> Your user profile is
            
          

提交回复
热议问题