Facebook Connect: Hata Facebook Connect butonuna tıkladığınızda

0 Cevap php

Ben connect butonu facebook tıkladığınızda ben bu hatayı alıyorum:

API Error Code: 100
API Error Description: Invalid parameter
Error Message: next is not owned by the application.

Ben bunu nasıl çok emin değilim, ama ben bağlamak facebook için tüm belgeleri okudum ve bu ile geldi:

<?php
date_default_timezone_set("America/Toronto");

define('FACEBOOK_APP_ID', '##################');
define('FACEBOOK_SECRET', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX');

function get_facebook_cookie($app_id, $application_secret) {
    if(!isset($_COOKIE['fbs_' . $app_id])) return null;
  $args = array();
  parse_str(trim($_COOKIE['fbs_' . $app_id], '\\"'), $args);
  ksort($args);
  $payload = '';
  foreach ($args as $key => $value) {
    if ($key != 'sig') {
      $payload .= $key . '=' . $value;
    }
  }
  if (md5($payload . $application_secret) != $args['sig']) {
    return null;
  }
  return $args;
}

$cookie = get_facebook_cookie(FACEBOOK_APP_ID, FACEBOOK_SECRET);


?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
    <head>
        <!-- JQUERY INCLUDE -->
        <script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>

        <!-- FACEBOOK CONNECT INCLUDE -->
        <script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US" type="text/javascript"></script>

        <script type="text/javascript">
        <!--
            $(document).load(function() {

            });

            FB.init("XXXXXXXXXXXXXXXXXXXXXXx

", "xd_receiver.htm"); FB.Event.subscribe('auth.login', function(response) { window.location.reload(); });

            function facebook_onlogin() {
                FB.getLoginStatus(function(response) {
                    if (response.session) {
                        // logged in and connected user, someone you know
                        fb_login.hide();
                    } else {
                        // no user session available, someone you dont know

                    }
                });
            }

        // -->
        </script>

    </head>

    <body>      
        <div id="fb_login">
            <fb:login-button onlogin="facebook_onlogin();" v="2">Log In with Facebook</fb:login-button>
        </div>

        <?php 
        $user = json_decode(file_get_contents(
            'https://graph.facebook.com/me?access_token=' .
            $cookie['access_token']))->id;

        ?>

    </body>
</html>

yeryüzünde ne bu işe alabilirim?

teşekkürler!

0 Cevap