Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7621683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:15:23+00:00 2026-05-31T04:15:23+00:00

Basically, I’ve just started some development on getting a Facebook Open Graph action for

  • 0

Basically, I’ve just started some development on getting a Facebook Open Graph action for our website. Now I have successfully implemented the Facebook Action and Objects but am getting a bit stuck here as the Facebook documentation doesn’t show many advanced examples.

I am trying to have a button on a page that will post an action to a user’s wall. However, at the moment the javascript throws an error if the user is not logged in to Facebook or authenticated the Facebook app.

Using the example in Facebook Documentation, this is what I have on my page so far.

My question is how do I adapt this to detect whether a user is logged into Facebook and/or authenticated with my Facebook App?? And if a user is not detected to be logged in/authenticated, display a Login button rather than the share button below.

If a Facebook is logged in, could it then just display the share button as it would do when using the code below.

<script type="text/javascript">
function shareme()
{
FB.api('/me/gradtouch:discover&company=URL','post',
                function(response) {
        if (!response || response.error) {
                alert('Error occured');
        } else {
            alert('Post was successful! Action ID: ' + response.id);
            }
    });
}
</script>

Thanks much appreciate any help, guidance or even if its a direction to where I can read up more about how I could write something that could do this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T04:15:24+00:00Added an answer on May 31, 2026 at 4:15 am

    Theres a few ways to detect whether a user is logged in or not, probably the most useful is to subscribe to the ‘auth.statusChange’ event

    http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/

    This should be called when FB sdk is finished intializing, with the status of the user (whether they are logged into FB, whether they have added your app, whether they are not logged in at all.. see: http://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/ )

    You can then display the relevant button, and if you need the user to login, just call FB.login() with permissions you need, and your event handler should be called again if their login status changes (ie, if they select to add the app. )

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically I have some code to check a specific directory to see if an
Basically, I have a JTextPane to hold some text which I wish to style.
Basically I have this server app I built in vc#, and for some reason
Basically i've a table for my users (it's nightclub website) and now i'm trying
Basically I have some sort of third party software running on Windows 7 which
Basically I would like to have some dictionary that is an abstaction over legacy
Basically for a Facebook tab I have a PHP app and want Heroku to
Basically from a database I am getting data that is formatted like this nameofproject101
Basically I have an iframe loaded that is accessed from the parent whenever it
Basically I have converted a tab delimited txt file into a list containing a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.