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

  • Home
  • SEARCH
  • 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 6622029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:21:03+00:00 2026-05-25T21:21:03+00:00

I have an app on facebook, which is kind of a competition between users.

  • 0

I have an app on facebook, which is kind of a competition between users. Each user gains points and the one with most points wins.

I keep the IDs of the users in a table in my database. When a user enters the app, there’s a script that checks if he is already in the table, and if not, it adds the user id to the table.

Then, I have a page that shows all of the users and how many points they have. I get through the graph api the user’s name by his ID, and then shows it on a nice table.

The only problem is: when a user that used the application once deletes it from his installed application on facebook, I can’t get his name anymore, and I get an uncaught OAuth exception.

How can I check if the user has installed the app, so I can display his name only if the app is currently installed on his facebook?

  • 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-25T21:21:03+00:00Added an answer on May 25, 2026 at 9:21 pm

    Basically, here is what you would need to do.

    <?php
    include_once("facebook.php");
    $facebook = new Facebook(array(
        'appId' => YOUR_APP_ID,
        'secret' => YOUR_APP_SECRET
    ));
    
    $user = $facebook->getUser();
    
    try {
        $user_profile = $facebook->api('/me');
    } catch(FacebookApiException $e) {
        $user = null;
    }
    
    if($user) {
        // authenticated user
        $name = $user_profile['name'];
    }
    

    This makes an API request for the current logged in user and, provided it fails, catches the exception and sets the $user variable to null. Then you can do a simple check to see if $user exists.

    Hopefully this will point you in the right direction.

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

Sidebar

Related Questions

I have an app where users can sign up with Facebook, in which case
I have a facebook app for which user grant me permission to access user_subscriptions
I have a Facebook app which posts news from a company website to the
I have an open-source app which uploads photos to Facebook. To save bandwidth, the
I have a facebook app and a user logs in and uses it. Simple.
I have a facebook app which runs in an iframe. When ever a new
We have created a facebook-app which contains a fb:comment field. We have included the
I have a facebook app that needs to allow a user to send a
So I have some kind of strange behaviour. I was developing an app which
We have a facebook app which does the job of posting updates throughout the

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.