检查用户是否喜欢带有 Laravel 社交名流的页面
check if user likes a page with Laravel Socialite
我正在使用 Laravel 社交名流让用户登录我的网站。我设法做到了这一点并存储了用户的数据。
但现在我想了解如何检查该特定用户(登录后)是否喜欢我的 Facebook 页面。
非常感谢!
Socialite 是一个使用 Facebook、Twitter、LinkedIn、Google、GitHub 和 Bitbucket 处理身份验证的软件包。它无法检索有关用户喜欢的信息。
您可以使用 facebook-php-sdk inorder to get the pages that user has liked. The code below is from the facebook graph api documentation 如何获取用户喜欢的页面。
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
$session,
'GET',
'/{user-id}/likes'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
我正在使用 Laravel 社交名流让用户登录我的网站。我设法做到了这一点并存储了用户的数据。
但现在我想了解如何检查该特定用户(登录后)是否喜欢我的 Facebook 页面。
非常感谢!
Socialite 是一个使用 Facebook、Twitter、LinkedIn、Google、GitHub 和 Bitbucket 处理身份验证的软件包。它无法检索有关用户喜欢的信息。
您可以使用 facebook-php-sdk inorder to get the pages that user has liked. The code below is from the facebook graph api documentation 如何获取用户喜欢的页面。
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
$session,
'GET',
'/{user-id}/likes'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */