facebook-javascript-sdk

Shop section of facebook pages through api/javascript sdk

点点圈 提交于 2019-12-22 05:16:26
问题 Facebook introduced a shop section for facebook pages. I need to manage my page's shop section through javascript sdk but I am unable to find the propoer docs or reference to do that. I know how to manage or update simple fields of your pages through sdk with post method using FB.api: FB.api(/page_id_and_post_method, function(response) { console.log("PAGEEEEEE DETAILS", response); }); So, the problem is that I just could not find the proper field name for that 'shop' section so as to update

How to set the access token with the Javascript SDK?

∥☆過路亽.° 提交于 2019-12-22 04:41:17
问题 I am searching for something similar to what Facebook::setAccessToken($access_token) does in the PHP SDK ; that is, set the access token used for subsequent requests (having retrieved it by other means). In the Javascript one, I can only find the getter ( FB.getAccessToken ). I imagine this has been made on purpose to avoid using the access token client-side, but what are the risks if only the user related to the access token can see it ? I could embed it as a parameter for each query, but

send Facebook request and get a gift FB API

霸气de小男生 提交于 2019-12-21 22:25:52
问题 I've managed to implement the "send Request" functionality for my App on facebook following the docs here Now, in case user 'A' accepts a request sent to him by user 'B', I want user 'B' to get an app-specific gift (image). My question is, how would I find out it was user 'B' who invited user 'A'? (and not user 'C') Thanks. 回答1: Store the request id in your database along with the user B who initiated the request. When user A clicks on the request they will be redirected to your app and

FB.api pagination without nesting

…衆ロ難τιáo~ 提交于 2019-12-21 20:46:34
问题 I'm trying to generate a users entire friend list via Facebook's javascript API. I am able to get 50 (or so) of the users friends using the following call. FB.api("me/friends",function(response){ //Do something with response }); I know if the user has more friends I can get 50 (or so) more with the following code: FB.api("me/friends",function(response){ if (response.paging.next != "undefined"){ FB.api(response.paging.next,function(response){ } } }); This however is not ideal because in order

Facebook - Posting to a Group page

喜你入骨 提交于 2019-12-21 20:38:57
问题 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

FB.Event.subscribe not firing for certain events

懵懂的女人 提交于 2019-12-21 17:43:04
问题 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

Is there a TypeScript interface definition for the Facebook JavaScript SDK

Deadly 提交于 2019-12-21 17:18:17
问题 The TypeScript package contains interface definitions for Node.js and jQuery. I was wondering if somebody has already wrote definitions for Facebook JavaScript SDK. 回答1: 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) 回答2: No, not officially produced or supported. But if the community creates one, we would be happy to link to & promote as required. 来源:

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

不羁的心 提交于 2019-12-21 16:49:45
问题 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

How to get user posts through facebook-sdk python api?

牧云@^-^@ 提交于 2019-12-21 11:35:13
问题 I use facebook-jssdk to authorize my application for read access to user profile and user posts. FB.login( function(response) { }, {scope:'user_status,user_likes,user_photos,user_videos,user_questions,read_stream,user_posts'} ); Then I'm trying to receive user posts. import json from time import mktime from urllib import urlopen from facebook import GraphAPI from datetime import datetime ga = GraphAPI() access_token = ga.get_app_access_token(settings.FACEBOOK_APP_ID, settings.FACEBOOK_APP

How to get user posts through facebook-sdk python api?

拜拜、爱过 提交于 2019-12-21 11:35:02
问题 I use facebook-jssdk to authorize my application for read access to user profile and user posts. FB.login( function(response) { }, {scope:'user_status,user_likes,user_photos,user_videos,user_questions,read_stream,user_posts'} ); Then I'm trying to receive user posts. import json from time import mktime from urllib import urlopen from facebook import GraphAPI from datetime import datetime ga = GraphAPI() access_token = ga.get_app_access_token(settings.FACEBOOK_APP_ID, settings.FACEBOOK_APP