更新时间:2023-12-01 18:56:16
如果您使用 facebook php API.我想出了这个简短的函数,你可以将它包含在 base_facebook.php 文件中到 BaseFacebook 类中.
If you use the facebook php API. i've came up with this short function that u can include inside the base_facebook.php file into the class BaseFacebook.
public function userIsFan() {
$sr = $this->getSignedRequest();
if($sr && is_array($sr)){
if(array_key_exists('page', $sr)){
return $sr['page']['liked'] == 1;
}
}
return 0;
}