facebook-javascript-sdk

How to use facebook publish stream method in a '.js' file

二次信任 提交于 2019-12-25 03:35:09
问题 I am using bellow code which is in a '.php' file, to publish stream. <script src="http://connect.facebook.net/en_US/all.js"></script> <script> FB.init( { appId : 'MY_APP_ID', status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); var publish = { method: 'stream.publish', message: '', picture : 'http://www.associationregion.org/images/stories/slides/Upload.png', link : 'http://apps.facebook.com/puzzlegts/'

Retrieve User ID of Facebook App Invitor

五迷三道 提交于 2019-12-25 02:24:22
问题 In the context of a given Facebook app, suppose User A invited user B to start using it. Once User B accepts to use the app, is there any way to retrieve the ID of User A programmatically (via either PHP/JS SDK) ? This doesn't seem quite documented. For what it's worth, A/B users are friends, if it's any use. 回答1: when user comes following the app request, you can get request id's using $_GET['request_ids'] then retrieve all the request ids with which you can call graph api to get the

Can I use the cookie c_user set by facebook?

本小妞迷上赌 提交于 2019-12-24 23:23:56
问题 Can I use cookie named c_user which contains the userid of facebook users who logged in? If it can be accessed by facebook php api, please provide me link. $session = $facebook->getSession(); Few suggested to use this above code to get session, but this function is not defined in facebook-php-sdk . Please show me a way to get user id of user currently logged in. Thanks 回答1: Please show me a way to get user id of user currently logged in. From http://developers.facebook.com/docs/reference

FB.login() causes Error 191 in any IE (Internet Exploder)

橙三吉。 提交于 2019-12-24 21:11:10
问题 I have searched this problem for long now but all answers have not worked so far. The code that calls for login: FB.login(function(response) { if (response.authResponse) { FB.api('/me', function(response) { document.getElementById("nimi").value = response.name; document.getElementById("email").value = response.email; FB.ui( { method: 'stream.publish', attachment: { name: 'Jõulupidu Maikrahv restoranis!', caption: 'Broneeri firma jõulupidu hubases Maikrahv restoranis! Kingime Uusaasta pidulaua

JS: Facebook Login button changes states if I login to facebook.com in another tab

南楼画角 提交于 2019-12-24 19:31:30
问题 My Facebook Login button is showing as Logged Out on my site. If I open a new tab in the browser, go to www.facebook.com and sign in successfully, then go back to the my website's tab and refresh the page, the facebook login button now shows as Logged In. Is that the expected behavior here? Seems strange since I never 'clicked' to log in with facebook on my site. function statusChangeCallback(response) { if (response && response.authResponse && response.authResponse.accessToken) { Cookies.set

AngularJS: user was not connected after a successful FB.login

北城以北 提交于 2019-12-24 18:23:17
问题 In a web app using AnularJS and the Facebook SDK, right after initing I'm calling FB.getLoginStatus() to check if user is connected: In my run method: window.fbAsyncInit = function() { FB.init({ appId : '186219064942355', xfbml : false, version : 'v2.10' }); FB.AppEvents.logPageView(); //$rootScope.$broadcast('fbInitiated'); $rootScope.$broadcast('checkFBLoginStatus'); }; (function(d, s, id){ var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement

Can we post photos on friends wall using Graph API

五迷三道 提交于 2019-12-24 17:53:16
问题 Is it possible to upload photos on friends wall? The documentation never mentioned that! but its happening. I am able to post to the /friend_id/photos connection. I am actually running my app on local server using localhost tunneling. So, in August, I made an app where people can post photos on their friends wall (upon their request only). So, As I was pretty new to FB API, I didn't notice that it is not allowed. I just left the app for few weeks and came back to fix things and I noticed that

POSTing an Array from a Facebook Graph API response by AJAX to a PHP script

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 13:19:33
问题 Hello_I’m making a Facebook Canvas App and I’m trying to get the Invite Friends process working. I have my multi-friend selector made, and it’s sending invites correctly, but I now want to reward the inviter whenever an invited person adds the app. I think the correct way to do this is to run a check whenever a new user begins using the app. I’m trying to do this by querying Facebook’s Graph API to see if the new user has an apprequest for my app, if they do, then I want to find out the ID

FB JavaScript iframe application is not auto redirecting to FB login page if no session available

∥☆過路亽.° 提交于 2019-12-24 11:01:54
问题 I am developing facebook iframe app with JavaScript.. the problem is when the user hits the app URL https://apps.facebook.com/projectanida/ I want users to see the application main page if they are already logged into fb and if there is no user session available then the user should be automatically directed to FB page asking for credentials to log into Facebook to use my app. Here is the code : var href = "https://projectafacebook.appspot.com/fb/"; var appliId = "165346656890746"; window

How to get Page Photo with the most likes & comments?

徘徊边缘 提交于 2019-12-24 09:49:23
问题 I'm using the Facebook PHP SDK to try and get the photo with the most number of likes for a Page, to be able to use as a "hero photo". The logic being that the photo with the most likes & comments is the most interesting to look at. However, the only method I can think of is slow and cumbersome. Is there a better method than using the below? 1. Query the Graph API for the albums belonging to a Page 2. Query the Graph API for Photos in each Album 3. Add the likes & comments for each photo 4.