Facebook OAuth Dialog White Screen

I am trying to get an access token using the latest SDK for PHP. As far as I know, I'm doing everything right, but when it redirects to facebook.com/oauth/dialog, it just has a white screen. My code is:

<div class="authorize_btn" style="float:right; margin-top:-35px; padding-right:10px">
    <?php
    include ('facebook/facebook.php');

    $facebook = new Facebook(array( 'appId' => 'xxxxx', 
                              'secret'  => 'xxxx', 
                              'cookie'  => true ));

    $session = $facebook->getUser();
    $me = null; 

    if ($session) {
                try {
                  $me = $facebook->api('/me');
                 }
              catch (FacebookApiException $e) { 
                                           echo $e->getMessage();
              }
    }

    if ($me) {
          $logout = $facebook->getLogoutUrl();
          echo "<button class='btn btn-primary'></button";
    } else {
        $login = $facebook->getLoginUrl();
        echo "<a href='$login'>Authorize</a>";
    }
    ?>
</div>
+3
source share
1 answer

Get the latest Facebook SDK for PHP - the one you use is about 2 years old and is not supported.

https://developers.facebook.com/docs/php/gettingstarted/4.0.0
0
source

All Articles