Tab Apps - signed_request
I have 2 FB profiles, one is a d开发者_StackOverflowev user that I develop apps with and the other my normal FB account.
I created a FB app with the dev user and linked it to a tab.
With my dev user when I view the tab and echo out the decoded signed_request i get the following output:
Array
(
[algorithm] => HMAC-SHA256
[expires] => 1317124800
[issued_at] => 1317118449
[oauth_token] =>xxxxxxxxxxxxxxxxxxxxxxxx
[page] => Array
(
[id] => xxxxxxxxxxxxxxxxx
[liked] =>
[admin] => 1
)
[user] => Array
(
[country] => xxxxxx
[locale] => en_US
[age] => Array
(
[min] => 21
)
)
[user_id] => xxxxxxxxxxxxxxxxxxxx
)
However when I setup my main user as an admin and then test the app my output looks like this:
Array ( [algorithm] => HMAC-SHA256 [issued_at] => 1317118842 [page] => Array ( [id] => xxxxxxxxxxxxxxx [liked] => [admin] => 1 ) [user] => Array ( [country] => za [locale] => en_US [age] => Array ( [min] => 21 ) ) )
You can see that that my [oauth_token], [expires] have been left out.
How can this be and what am I doing wrong?
Cheers
Phil
Looks like the second user hasn't authorised the app. The API will only pass UID, tokens & expires for TOS'd users.
A user MUST interact with a tab before it is given an oauth_token. This is why you have no [user_id] on the second print_r.
精彩评论