facebook-javascript-sdk

Facebook Javascript SDK: Processing Response from Facebook

孤街浪徒 提交于 2019-12-11 04:58:45
问题 I'm having trouble understanding how to process the response when you make an API call to facebook. Should mention that I'm new to javascript. Say I want to get the mutual friends between me and some user, and then write it to a text box. I took a shot and ended up with this ...which failed. I'm pretty sure it's because I didn't parse the response, but I can't figure out how. I've seen something like query.wait(function(rows){ for FQL queries ... but I don't know what that means..so I skipped

How does Facebook fun apps create images from information fetched?

自作多情 提交于 2019-12-11 04:57:58
问题 This thing is really irritating. Actually I know how to convert HTML to image using html2canvas library. But I just want to know how most of the people who have Facebook fun apps like this and this, create images. I can get all the required user information using FB API , then how should I create an JPG/PNG image like them? What I have tried is html2canvas but I don't think all other fun apps use this thing. Because when viewed their source code, I couldn't see the HTML element containing all

Send dialog doesn't work in page tab

余生颓废 提交于 2019-12-11 04:57:10
问题 Send dialog doesn't work in iframe page tab. did as in example on 'Send Dialog' page https://developers.facebook.com/docs/reference/dialogs/send/ <html xmlns:fb="https://www.facebook.com/2008/fbml"> <body> <script src="http://connect.facebook.net/en_US/all.js"></script> <div id="fb-root"></div> <script> // assume we are already logged in FB.init({appId: '123050457758183', xfbml: true, cookie: true}); FB.ui({ method: 'send', name: 'People Argue Just to Win', link: 'http://www.nytimes.com/2011

not getting new facebook page in page list using FB apis

允我心安 提交于 2019-12-11 04:47:56
问题 I have created new facebook page and now trying to fetch the page list. But I am getting new page in my list. Api I am using below:- https://graph.facebook.com/v2.11/me/accounts?access_token=xxxxxxxxxxxxxxxxxxxxxxxxxxx&user_id=xxx 来源: https://stackoverflow.com/questions/52903989/not-getting-new-facebook-page-in-page-list-using-fb-apis

Facebook comment.create not firing on mobile - ios Safari and android browser

泄露秘密 提交于 2019-12-11 04:35:44
问题 This is making me crazy - I can't get the facebook comment.create event to fire on mobile devices (not that I tested work). login event is working fine (auth.authResponseChange) <html> <head></head> <body> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ appId : 'MYAPPID', // App ID channelUrl : '//WWW.MYAPPURL.COM/channel.html', // Channel File status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml :

Automatically invoking FB.login on Facebook page tab app for non-logged in user

南笙酒味 提交于 2019-12-11 03:54:09
问题 I have a Facebook Page tab app. For a user who is not logged in, I want to: Detect if user is not logged in If not logged in, automatically direct user to login My current approach is to use FB Javascript SDK (in preference to server-side authentication flow): On page load, run FB.getLoginStatus to check user status If user is not logged in, run FB.login to invoke OAuth dialog Problem: FB.login creates a pop-up dialog (prefer if within Page Tab iframe) This pop-up dialog is blocked if FB

fb-video change url and reload player at runtime (without page refresh)

倾然丶 夕夏残阳落幕 提交于 2019-12-11 03:05:29
问题 How do I change the video URL of fb-video at runtime and make the player reload the video without page refresh: <div id="fb-root" style="height: auto"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.4"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <div class="fb-video" data

Optimizing and loading external dependencies with requirejs

送分小仙女□ 提交于 2019-12-11 02:28:19
问题 I have a module that requires the Facebook SDK. I'm wondering how I should configure loading of the SDK so that it's handled properly by the RequireJS optimizer. In app: require.config({ paths: { 'facebook' : '//connect.facebook.net/en_US/all' } }); In build profile: { ... paths: { 'facebook' : 'empty:' } } As far as I understand it, the code above forces the optimizer to skip optimization of that script. The problem is, the SDK is no longer loaded after optimization. 回答1: As part of the

Facebook API Error code: 100 Error Message: Viewer cannot message specified recipients

末鹿安然 提交于 2019-12-11 02:22:34
问题 I'm using the Facebook JS SDK to let my site's users send FB messages from my site. I periodically see the following error: API Error Code: 100 API Error Description: Invalid parameter Error Message: Viewer cannot message specified recipients. I'm confused because it doesn't happen consistently. It's more like once in every 8 attempts, with no apparent pattern. Any ideas? Here's my code. First... <script> window.fbAsyncInit = function() { FB.init({ appId : '##########', // App ID channelUrl :

Unmute facebook live video

≯℡__Kan透↙ 提交于 2019-12-11 02:20:59
问题 I am currently trying to embed a facebook live video that will auto play with the audio unmuted. I've tried to use the solution in this post however it does not seem to work on live videos as the xfbml.ready event does not seem to get called. Has anybody figured out a way to enable the audio on a live embedded video? 回答1: The trick is, that you shouldn't use autoplay and then unmute, rather normally embed the video, then start it by msg.instance.play() . See the code below, or try this link: