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 779767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:58:38+00:00 2026-05-14T19:58:38+00:00

Howdy. I’ve been tasked with making a Facebook game, but I’m new to Facebook

  • 0

Howdy. I’ve been tasked with making a Facebook game, but I’m new to Facebook development, so I’m just getting started. Apologies in advance if this is a no-brainer to people.

I’m having trouble following all the examples I see on sites, and I keep running into missing pages in the Facebook documentation when I am trying to read up. I think it’s because there’s a new version of the PHP Client Library for Facebook, and everything I’m finding is referring to the old client.

For instance, I see this code in a lot of examples:

require 'facebook.php';
$facebook = new Facebook( array( 'appId' => '(id)', 'secret' => '(secret)' ) );
$facebook_account = $facebook->require_login();

…but there’s no “require_login()” in the client library provided in the facebook.php file.

From what I can tell, it looks like Facebook has very recently rolled out some new system for development, but I don’t see any sample code anywhere to deal with it. The new library comes with an “example.php” file, but it appears to be only for adding “Log in with Facebook” functionality to other sites (what I’m assuming is what they mean by “Facebook Connect” sites), not for just running apps in a Canvas page on Facebook itself.

Specifically, what I need to do is let users visit an application page within Facebook, have it bring up the dialog box allowing them to authorize the app, have it show up in their “games” page, and then have it pass me the relevant info about the user so I can start creating the game. But I can’t seem to find any tutorials or examples that show how to do this using the new library. Seems like this should be pretty straightforward, but I’m running into roadblocks.

Or am I missing something about the PHP client library? Should require_login() be working for me, and there’s something broken with my implementation, such as having the wrong client library or something? I downloaded from GitHub yesterday, so I’m pretty sure I have the most recent version of the code I have, but perhaps I’m downloading the wrong “facebook.php” file…?

  • 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-14T19:58:39+00:00Added an answer on May 14, 2026 at 7:58 pm

    The following is a rewrite of the old require_login function. It exactly duplicates the old functionality.

    function facebook_require_login($required_permissions = '')
    {
      global $facebook; // NOTE GLOBAL FACEBOOK OBJECT, MUST ALREADY BE INSTANTIATED
    
      $user = $facebook->get_loggedin_user();
      $has_permissions = true;
    
      if ($required_permissions) {
        $facebook->require_frame();
        $permissions = array_map('trim', explode(',', $required_permissions));
        foreach ($permissions as $permission) {
          if (!in_array($permission, $facebook->ext_perms)) {
            $has_permissions = false;
            break;
          }
        }
      }
    
      if ($user && $has_permissions) return $user;
    
      $facebook->redirect(
        $facebook->get_login_url(Facebook::current_url(), $facebook->in_frame(),
                             $required_permissions));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Howdy, I'm currentyl new to Java and Android but I would like to write
EDIT: This question is solved, but I can't accept my own answer just yet.
Howdy, I do know how to implement a simple bubble-sort for 1dimensional array. But
This could well be a stupid question, but I'm new to Java, so... I've
Howdy fellas, this one is gonna be a doozy: So for awhile I've been
Howdy, I am writing a GRE app on android.i am new in this arena.
Howdy, I'm having a bit of a problem getting my unit tests to pass.
Howdy and Thanks in Advance! I'm trying to access the USB port from a
I'm fairly new to Java (been writing other stuff for many years) and unless
Howdy! I am looking for a way to list all of the image files

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.