Only select Native/Desktop if you you have embedded your App Secret in your client app. For all other cases you should choose Web.
Why I Bring this out?
Because of the wrong settings, I have spent 2 hours to debug a ‘bug’ that Facebook PHP SDK $facebook->getUser();
is always return 0
, by the way, I think Facebook PHP SDK should give some useful feedback instead of just return 0
in such case.
Lesson learnt
- Read the documentation carefully before start coding, especially when doing application for Facebook, the settings page has so many things to be filled up.
- I need to find a way in PHP to do something like python
ipdb.set_trace()
so that I can step through the process and figure out what causes the error. - Have a rest if you mind is blowing up, take a step back to see the problem. >_<