facebook-javascript-sdk

Facebook - Posting to a Group page

为君一笑 提交于 2019-12-04 14:07:31
I am attempting to post on a group page using the FB JS API, basically the user selects the group they want to post onto, and it posts it to the wall. i am doing: FB.ui( { method: 'stream.publish', from: myId, to: groupID, attachment: { name: 'Post to a group Test, href: 'http://www.test.com' } }); But when i try it, it says: An invalid target was specified: <(groupid)>. The target must be a page, event, or user that the actor can post on the wall of. Thou, i know i can post on the group page, so i dont know why it says that. And i am not talking about fan pages, i can post on them ok setting

FB.login inside FB.getLoginStatus popup window blocked

久未见 提交于 2019-12-04 12:03:57
问题 I'm trying to integrate Facebook login into my website with Facebook Javascript SDK. According to the step by step instructions provided by Facebook Developer document here, here is the test code I wrote: <script> window.fbAsyncInit = function() { FB.init({ appId : '{$MY_APP_ID}', cookie : true, // enable cookies to allow the server to access the session xfbml : true, // parse social plugins on this page version : 'v2.1', // use version 2.1 status : true, // check FB login status }); };

Notification for facebook app requests not showing up

人走茶凉 提交于 2019-12-04 11:32:49
I created an application for a website and gave it a site url. (The site url is actually not real. It is overridden in my local hostname file for development purposes. Does this matter?). I used the sample code for creating a request dialog to send requests to another facebook account. I used the multi-user interface, without the to: field. When I refresh the page in my other facebook account, I see a red 1 on the world icon for just a split second, but then it disappears and there is no notification to be found. It does this every time I send a request. Is there something wrong with my

Unable to load full Facebook comment plugins inside an iOS UIWebView

可紊 提交于 2019-12-04 11:13:59
I have a simple ViewController to load FB comments plugins inside a UIWebView @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; UIWebView * webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320.0f, 1505.0f)]; NSString * html = @"\ <!DOCTYPE html>\ <html xmlns:fb='http://ogp.me/ns/fb#'>\ <head>\ <meta name='viewport' content='width=device-width, initial-scale=1.0'>\ </head>\ <body style='background-color:red;'>\ \ <div id='fb-root'></div>\ <script>(function(d, s, id) {\ var js, fjs = d.getElementsByTagName(s)[0];\ if (d.getElementById(id)) return;\ js = d

getLoginStatus not firing with calling from FB canvas

妖精的绣舞 提交于 2019-12-04 10:36:41
Attempting a client site authorization, and attempting to run within a canvas. If I access the my website directly http://mysite.com/ everything works. If I try to run via canvas https://apps.facebook.com/myapp it runs but getLoginStatus does not fire at all. var curLoc = window.location; FB.init({ appId: 'xxxxxxxxxxxxxxx', // App ID channelUrl: curLoc.protocol + "//" + curLoc.hostname + ":" + curLoc.port + "/channel.html", cookie: true, // enable cookies to allow the server to access the session status: true, oauth: true, xfbml: true }); FB.getLoginStatus(function (response) { if (response

Facebook share with custom parameters with API version 2.9

扶醉桌前 提交于 2019-12-04 10:26:34
I need to share a result of a quiz on facebook containing a custom title, picture and description. Wich worked perfect before update to version 2.9 on April 18 . But it isn't working with Version 2.9. So am I missing out something there? Or does Facebook don't want us to share custom Facebook Feeds of our websites in 2017? For my Setup for a test facebook feed I coded strictly with Facebook Developers Documentation . Facebook Changelog v2.9 says parameter picture, name, description and caption are not supported anymore. My fb api init: <script> window.fbAsyncInit = function() { FB.init({ appId

FB.Event.subscribe not firing for certain events

*爱你&永不变心* 提交于 2019-12-04 10:23:16
So I'm trying to do some event handling when a user clicks the like button. My Facebook button is being created asynchronously via: (function() { var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; document.getElementById('fb-root').appendChild(e); }()); And that works great. I have the following function running as well: window.fbAsyncInit = function() { FB.init({status: true, cookie: true, xfbml: true}); FB.Event.subscribe("xfbml.render", function() { console.log('xfbml.render'); FB.Event.subscribe("edge.create

How bad is publishing the app secret really?

南笙酒味 提交于 2019-12-04 09:54:31
After significant voodoo, I have finally got the scores API working. Turns out you have to set Enhanced Auth Dialog to disabled or Facebook ignores your publish_actions permission. Just a heads up in case anyone else is struggling. However, I'm working entirely in the Javascript API. No server-side scripting is available. The only way to publish a score is with an app access token. The only way to get one of them is to use the app secret, and that would have to be in the javascript code for the world to see. How bad is that exactly? TBH I don't care if someone spoofs the scores to my little

Is there a TypeScript interface definition for the Facebook JavaScript SDK

▼魔方 西西 提交于 2019-12-04 08:31:45
The TypeScript package contains interface definitions for Node.js and jQuery. I was wondering if somebody has already wrote definitions for Facebook JavaScript SDK. tremby You can get it with tsd by typing tsd install fbsdk --save . Here it is in Definitely Typed: https://github.com/borisyankov/DefinitelyTyped/blob/master/fbsdk/fbsdk.d.ts (From this answer ) No, not officially produced or supported. But if the community creates one, we would be happy to link to & promote as required. 来源: https://stackoverflow.com/questions/12722039/is-there-a-typescript-interface-definition-for-the-facebook

Facebook Error 100: You cannot specify a scheduled publish time on a published post

让人想犯罪 __ 提交于 2019-12-04 08:12:43
I just had to do this. Absolutely every question I looked up questions regarding this issue but none of their answers helped me solve it. I am trying to post on my Facebook page. Here is the issue: Error: "(#100) You cannot specify a scheduled publish time on a published post" Code: FB.api( "/100177680105780/feed", "POST", { "message": "This is a test message", "scheduled_publish_time": Math.round(new Date().getTime() / 1000) + 120 }, function (response) { console.log(response); if (response && !response.error) { /* handle the result */ } }); I have no idea why this is giving me this error. It