doujiexi1824 2015-08-01 08:06
浏览 45

FB PHP SDK:可以在Localhost中获取公共详细信息,但不能在Live Server中获取

This code displays complete FB details in localhost but only display id and name in live server.

if ($session){ //if we have the FB session
     //get user data
     $user_profile = (new FacebookRequest($session, 'GET', '/me'));

     $response = $user_profile->execute();
     $graphObject = $response->getGraphObject();

     // print data
     echo  print_r( $graphObject, 1 );
}

Sample Localhost output (Complete Public Details):

Facebook\GraphObject Object ( [backingData:protected] => Array ( [id] => 101 [email] => myEmail@gmail.com [first_name] => MyFname [gender] => male [last_name] => MyLName[link] => https://www.facebook.com/app_scoped_user_id/101/ [locale] => en_US [name] => MyFname MyLname [timezone] => 4 [updated_time] => 2015-05-18T05:51:40+0000 [verified] => 1 ) ) 

Sample Live Server Output (Fb Id and Fullname only):

Facebook\GraphObject Object ( [backingData:protected] => Array ( [name] => Name LastName [id] => 101 ) )

Permission: All Set

$required_scope     = 'public_profile, email';

Thanks for your help (IA).

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 java写代码遇到问题,求帮助
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?
    • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
    • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计