PHP SDK 3.1.1 getUser() sometimes return 0

前端 未结 5 907
日久生厌
日久生厌 2020-12-17 21:32

This is driving me crazy >=(

$facebook->getUser() works well sometimes, but sometimes returns 0

Here is my code: require \'fbapi/facebook.php\';
$

5条回答
  •  一向
    一向 (楼主)
    2020-12-17 21:46

    It's more than likely something on Facebook's end (devs have gone through this before a while back). If $user returns null or 0, simply reroute them to the login url (which you should have). The liklihood of it returning 0 again is minimal (unless there's a bug on their end or there's more to your code than what you've posted).

提交回复
热议问题