52017

FB.getLoginStatus inside edge.create callback is returning unknown status and null session after log

Has anybody tested the scenario below?

1- Log out of Facebook

2- Go to page that has the like button

3- Click like then log in to Facebook from the popup window

I am subscribed to edge.create and calling FB.getLoginStatus(function(response) { }); in order to make sure the user is logged in when the like button is clicked.

When the like button is clicked, response status is unknown and session is null which is not what I'm expecting there.

FB.Event.subscribe('edge.create', function(href) { FB.getLoginStatus(function(response) { alert("inside edge create login status callback" + JSON.stringify(response)); }); });

Answer1:

Found the solution: Calling FB.getLoginStatus with the second param "true" forces it to get the login status from the server.

FB.getLoginStatus(function(response) {}, true)

Recommend

  • When is Facebook deprecating the JavaScript SDK?
  • How to fix error 'FB' is not defined no-undef on create-react-app project?
  • facebook fan gate only work with admin account Javascript
  • Updating Signed Request using Javascript OAuth 2.0 SDK
  • Use Amazon SNS to send SMS messages using PHP AWS SDK v2?
  • Mailchimp - how can I tell if a user has unsubscribed themselves?
  • How to implement 'category' based newsletter
  • How to submit the form from parent component?
  • PushPad: Subscribe is removed after site refresh
  • How do you download a image/png data URI in Edge?
  • Controlling tab space in a using CSS?
  • How to logout from facebook connect in asp.net?
  • How to show different validation messages for email validation in Angular2 using Validators class?
  • Remove border around the color in an input[type=color] in Firefox?
  • Overriding window.location on Webbrowser Control
  • Adding directive inside the directive programatically
  • iOS Localization Doesn't Work with More Than 63 Files
  • why calling cd shell command through system() or execvp() from a child process won't work?
  • Breeze - Deleted Items nav properties bug
  • QLineEdit password safety
  • javaw.exe and eclipse startup problems
  • Why winpcap requires both .lib and .dll to run?
  • Is there a mandatory requirement to switch app.yaml?
  • Comma separated Values
  • File upload with ng-file-upload throwing error
  • ExecuteAsync RestSharp to allow backgroundWorker CancellationPending c#
  • AngularJs get employee from factory
  • Rails 2: use form_for to build a form covering multiple objects of the same class
  • Error creating VM instance in Google Compute Engine
  • Hits per day in Google Big Query
  • how does django model after text[] in postgresql [duplicate]
  • need help with bizarre java.net.HttpURLConnection behavior
  • Authorize attributes not working in MVC 4
  • Busy indicator not showing up in wpf window [duplicate]
  • Reading document lines to the user (python)
  • Binding checkboxes to object values in AngularJs
  • Python/Django TangoWithDjango Models and Databases
  • Net Present Value in Excel for Grouped Recurring CF
  • jQuery Masonry / Isotope and fluid images: Momentary overlap on window resize
  • How to load view controller without button in storyboard?