facebook-php-sdk

facebook graph api check if user is a member of a group using PHP

守給你的承諾、 提交于 2019-11-29 15:18:42
问题 i want to check if a user is a member of a group using facebook graph api... i have this: $group = file_get_contents("https://graph.facebook.com/177129325652421/members?access_token=XXXXXXXX"); $group = json_decode($group); $checkuser = $group->data; and check the user if is a member by using his facebook id and in_array() if(in_array($_GET["fid"],$checkuser)){ echo "yes"; } else { echo "no"; } can someone help me to correct this please... my code is not working... 回答1: Reference: https:/

Integrating facebook php sdk in Facebook Canvas App giving Blank page or oauthData error

a 夏天 提交于 2019-11-29 12:05:49
I am trying to integrate facebook for my canvas app. When i run app from facebook with following code // init app with app id (APPID) and secret (SECRET) FacebookSession::setDefaultApplication('xx','xx'); $helper = new FacebookCanvasLoginHelper(); try { $data = array('oauth_token' => 'token'); $data['algorithm'] = 'HMAC-SHA256'; $data['issued_at'] = time(); $base64data = base64_encode(json_encode($data)); $rawSig = hash_hmac('sha256', $base64data, 'app_Secret', true); $sig = base64_encode($rawSig); $signedRequest = $sig.'.'.$base64data; $_GET['signed_request'] = $signedRequest; $session =

Error on Login using Facebook PHP SDK with Strict Mode Enabled

回眸只為那壹抹淺笑 提交于 2019-11-29 09:44:38
问题 I got a notification from Facebook saying that they will invalidate calls from URIs not listed in the Valid OAuth redirect URIs this coming March 2018 and I think they are requiring us to Enable Strict Mode for Redirect URIs. Link about this can be found here. I have been using their PHP SDK with Strict Mode disabled for a year now without any problem however when I do enable strict mode and place there the redirect url which is: https://nino-dot-dynamic-osprey-93721.appspot.com/admin/fb

PHP SDK: How do I capture the access token after user auths app?

怎甘沉沦 提交于 2019-11-29 08:56:55
This is for a canvas app on the Facebook Platform using the new(est) Facebook PHP SDK. We are using the PHP example from the Facebook tutorial (https://developers.facebook.com/docs/appsonfacebook/tutorial/) to trigger the OAuth dialog and get the test user to the redirect URL. At the redirect URL, we use the PHP example from the Facebook signed request docs page (https://developers.facebook.com/docs/authentication/signed_request/) and our test users can successfully authorize the app. However, after the test user auths the app, we are not able to capture the access token and its expiration. We

Graph API new feed post object-Attachment not showing

≯℡__Kan透↙ 提交于 2019-11-29 08:14:05
问题 I'm having a strange problem with the graph API, the below code used to work for me adding a post to a users news feed with a thumbnail of the attached photo (referenced in 'object_attachement' parameter). However now the post is created as expected however the thumbnail is empty. The photo_id I am using exists in the user's photo collection. $photo_ID = "3415678920211";//Valid Facebook Photo ID... $facebook = new Facebook($config); $attachment = array( 'access_token' => $user_token, 'message

PHP SDK 3.1.1 getUser() sometimes return 0

↘锁芯ラ 提交于 2019-11-29 06:40:37
This is driving me crazy >=( $facebook->getUser() works well sometimes, but sometimes returns 0 Here is my code: require 'fbapi/facebook.php'; $facebook = new Facebook(array( 'appId' => 'xxx', 'secret' => 'xxxxx', )); $user = $facebook->getUser(); the appId and secret are the correct ones. Which could be the reason that getUser sometimes it returns 0??? It's more than likely something on Facebook's end (devs have gone through this before a while back). If $user returns null or 0, simply reroute them to the login url (which you should have). The liklihood of it returning 0 again is minimal

Facebook Login with Sentry, A password is required for user [email], none given

无人久伴 提交于 2019-11-29 05:03:09
I'm trying to allow users to login using facebook but my user management is based on sentry as you know if you connect from facebook, you wont need a password unless you are creating a account normally. Is there a way to tell sentry( http://docs.cartalyst.com/sentry-2/installation/laravel-4 ) that this is a facebook login and it doesnt require a "password" I tried giving the account a temp password but i receive A hasher has not been provided for the user , even when i hash it. Any advice on this? I'm also using http://maxoffsky.com/code-blog/integrating-facebook-login-into-laravel-application

How to log out user from facebook application, but maintain login from facebook

时光总嘲笑我的痴心妄想 提交于 2019-11-29 04:12:16
I have tried the PHP SDK (v.3.1.1), and the current Javascript SDK as suggested here : https://developers.facebook.com/docs/guides/web/ now when trying to log out I have tried both FB.logout() ( for js ) and $facebook->getLogoutUrl() ; as the documentation for both clearly state, these methods log the user out of the application as well as their facebook session. But I only need to log the user out of the facebook application ( the test site ). I have tried logging the user out of my test site, ignoring the facebook aspect. But in this case, when the user clicks the login button again, the

Getting Facebooks' Cover Photo via PHP SDK & Graph API

柔情痞子 提交于 2019-11-29 02:52:16
问题 I'd like to know if there is a simple way of retrieving the Cover photo from a user in my application, via the facebook php sdk. Thanks in advance. 回答1: Facebook seems to have added the Cover field to User Object recently https://graph.facebook.com/facebookuserid?fields=cover will give you the user cover pic Details Facebook Doc Link : http://developers.facebook.com/docs/reference/api/user/ 回答2: I think the easiest is to use the graph api: http://graph.facebook.com/{user_id or page_id}?fields

Facebook getUser() function returning user ID after logout

穿精又带淫゛_ 提交于 2019-11-29 01:09:24
问题 I'm developing using the Facebook PHP SDK. I wanted to make it so that when the user logs out of Facebook, they will automatically be logged out of my website too. I am using the following code to detect the session, using the session cookie: $facebook->getUser(); For some reason, the getUser() function still returns the user's Facebook ID, even after they have logged out of Facebook on their website. Am I to detect the session first using another Function? On the official documentation