PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, February 11, 2022

[FIXED] facebook signed_request doesn't contain 'liked' parameter

 February 11, 2022     facebook, facebook-like, facebook-php-sdk     No comments   

Issue

I'm trying to check whether a user has liked my app using this code:

$signed_request = $facebook->getSignedRequest();
$liked = $signed_request['page']['liked'];
echo($liked);

But it doesn't return anything. On the other hand, if I do:

$signed_request = $facebook->getSignedRequest();
$expires = $signed_request['expires'];
echo($expires);

it does return an appropriate value. Is this something to do with permissions?

thanks


Solution

You can get page info parameters with signed_request only if it is a page tab application. If it is a canvas app, you can get like info with a FQL query:

SELECT uid FROM page_fan WHERE page_id="PAGE_ID" and uid = me()


Answered By - aykut
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing