facebook-php-sdk

Access Facebook Session using PHP

筅森魡賤 提交于 2019-12-22 10:32:00
问题 I am struggling to keep the Facebook session alive using PHP on my website. I use both the JavaScript SDK and the PHP SDK to form the basis of my app. The problem I am having is that when the "Facebook session" ends, my PHP script believes that you are logged out of Facebook. But, as soon as I call the FB.init() using the JavaScript SDK, the session comes back to life. Is there anyway to achieve the same using the PHP SDK? Or can I set a custom expiry time on the Facebook session? Extracted

facebook sdk php example not working

感情迁移 提交于 2019-12-22 08:19:38
问题 I am trying to develop facebook login for a website, i tried the example given with php-facebook-sdk even after login to facebook the $user variable is still 0 even after facebook login it is not showing logout url. call to $facebook->getUser(); function is allways returning 0. require '../src/facebook.php'; // Create our Application instance (replace this with your appId and secret). $facebook = new Facebook(array( 'appId' => 'xxx', 'secret' => 'xxxx', )); // Get User ID $user = $facebook-

Force links to open outside facebook's inapp browser

痞子三分冷 提交于 2019-12-22 06:02:01
问题 Facebook updated it's mobile app and created an in-app browser and as they say it's more faster. The problem is that any link of any page opens inside this browser. I tried a lot of combinations without luck... Some examples are bellow. Did anyone knows more about it and how to forece links to open on external browsers? <script> function externalLinks() { for(var c = document.getElementsByTagName("a"), a = 0;a < c.length;a++) { var b = c[a]; b.getAttribute("href") && b.hostname !== location

Force links to open outside facebook's inapp browser

◇◆丶佛笑我妖孽 提交于 2019-12-22 06:01:07
问题 Facebook updated it's mobile app and created an in-app browser and as they say it's more faster. The problem is that any link of any page opens inside this browser. I tried a lot of combinations without luck... Some examples are bellow. Did anyone knows more about it and how to forece links to open on external browsers? <script> function externalLinks() { for(var c = document.getElementsByTagName("a"), a = 0;a < c.length;a++) { var b = c[a]; b.getAttribute("href") && b.hostname !== location

Facebook App - The domain of this URL isn't included in the app's domains. Why?

孤者浪人 提交于 2019-12-22 06:00:12
问题 When trying to login with a Facebook app, I'm getting the following error: Can't Load URL: The domain of this URL isn't included in the app's domains. To be able to load this URL, add all domains and subdomains of your app to the App Domains field in your app settings. As you can see on the following image: URL: http://www.facebook-php-test.com Below is the configuration I have set on my Facebook App. ( Notice: for privacy purposes I changed the values for App ID and App Secret on the image)

Facebook Marketing API Rate Limit

随声附和 提交于 2019-12-22 05:43:31
问题 I know that fb have made available some documentation about the requests limits to the api https://developers.facebook.com/docs/marketing-api/api-rate-limiting, but it is not clear how each api call is calculated... i.e, If I want to get stats for ~10,000 adsets, how can I evenly space the time between the calls ? 回答1: The best answer i could find for this question from another SO thread - "After some testing and discussion with the Facebook platform team, there is no official limit I'm aware

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

Auto post stream (feed) to app users

别来无恙 提交于 2019-12-22 01:30:40
问题 How can i post stream ( $facebook->api('/me/feed', 'post', $attachment); ) to my app users on anytime. I think i can get access token via $facebook->getAccessToken(); but after, how can i post to wall? 回答1: Grant the publish_stream permission and use the user id after that instead of me : $facebook->api("/$user_id/feed", 'post', $attachment); For more information, check the last edit ( EDIT 4 ) on this answer (also follow the discussion on the other answer that I linked to there). 回答2: First:

Facebook- Publishing a story to user's wall

大憨熊 提交于 2019-12-22 00:56:21
问题 I am using facebook-php-sdk and my requirement is to post a story to the user's wall. My app requests the user for 'publish_stream' permission at the time of signup/login. After user has allowed the permission and logged in, somehow I am not able to publish to facebook wall a new comment created by the user on my app. This is the error I get: Invalid OAuth access token signature This is what I do: $facebook = new Facebook(array( 'appId' => "$fb_app_id", 'secret' => "$fb_secret", 'cookie' =>

Facebook API: What is the Max length of 'message' on wall?

独自空忆成欢 提交于 2019-12-21 20:24:56
问题 I've scoured the Facebook documentation and I can't find the maximum length that can be passed to the Facebook API? If I pass a large value to the API using AJAX and using the PHP SDK, I'm getting neither and error or success message. (and no message on the wall). I'd like to restrict the user to the correct length to avoid any problems. Thanks for your assistance, Luke 回答1: If the message is a status update (that is, you're not including an attachment or an action link), it can contain up to