Help Needed with "FB.getLoginStatus"

Discussion in 'Facebook API' started by Rajnish357, Jan 27, 2012.

  1. #1
    FB.getLoginStatus allows you to determine if a user is logged in and connected to your app.
    http://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/

    I wanted to use it can anyone please give me the complete code for this:

    If User is logged in and connected to app then output: Logged in and Connected
    If User is logged in but not connected to app then output: Logged in Not Connected
    If User is not logged in then output: Not Logged in

    ??

    Please Help Someone, I need to use this function on my HTML Site. Please
     
    Rajnish357, Jan 27, 2012 IP
  2. DogDice

    DogDice Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #2
    Maybe this is something for you:


    
    FB.getLoginStatus(function(response) 
    {
      if (response.status === 'connected')
      {
        // the user is logged in and has authenticated your
        // app
        document.write("Logged in and connected");
      } else if (response.status === 'not_authorized') {
        // the user is logged in to Facebook,
        // but has not authenticated your app
        document.write("Logged in Not connected");
      } else {
        // the user isn't logged in to Facebook.
        document.write("Not Logged in");
      }
     });
    
    Code (markup):
     
    DogDice, Jun 18, 2012 IP