Facebook PHP SDK - getUser() suddenly returns 0

前端 未结 4 1547
Happy的楠姐
Happy的楠姐 2021-01-12 06:31

First of all, to get this out of the way, I\'ve spent hours looking through answers to this question here on StackOverflow, and tried to solve it on my own, but it just isn\

4条回答
  •  迷失自我
    2021-01-12 06:49

    I had the same problem. It turned out i was using localhost. Though the allow access dialog appeared on facebook and i was redirected back to my web page, getUser still returned zero.

    My Solution

    Once i uploaded my code and tested it online, reasonable facebook errors appeared then had to change my "App Domains" and "Site Url" to relevant values for my online test website NOT localhost. And then it worked!

提交回复
热议问题