facebook图api注销网址无效

时间:2014-07-15 15:31:32

标签: php facebook-graph-api

我正在使用facebook的图形api版本3.1.1 它工作正常,但注销网址无法正常工作。

使用注销网址,它将从Facebook注销,但它未在我的应用程序中注销。奇怪但真实。

我正在从代码中粘贴必要的snipet。

的index.php

<script type="text/javascript">
            function streamPublish(name, description, hrefTitle, hrefLink, userPrompt) {
                FB.ui({method: 'feed',
                    message: userPrompt,
                    link: hrefLink,
                    caption: hrefTitle,
                    picture: ''
                });
                //http://developers.facebook.com/docs/reference/dialogs/feed/
            }
            function publishStream() {
                streamPublish("Stream Publish", 'Checkout personalized products at www.picpixa.com. I found some of them are just awesome!', 'Checkout www.picpixa.com', 'http://www.picpixa.com', "Personalized Products");
            }
        </script>

        <style type="text/css">
            .box{
                margin: 5px;
                border: 1px solid #60729b;
                padding: 5px;
                width: 500px;
                height: 200px;
                overflow:auto;
                background-color: #e6ebf8;
            }
        </style>
        <div id="fb-root"></div>
        <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
        <script type="text/javascript">
            FB.init({
                appId: '',
                status: true, // check login status
                cookie: true, // enable cookies to allow the server to access the session
                xfbml: true // parse XFBML
            });
        </script>

    <body>
        <div id="load" class="loader"></div>
        <div class="container">
            <div class="row">
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <div class="modal-footer">
                        <?php 
                        echo "User: $user";
                        if (!$user) { ?>
                            <h1>You have to login using Facebook Login Button to see your uploaded images.</h1>
                            <a class='btn btn-primary' href="<?= $loginUrl ?>" onClick='loader()'><img src="Images/login.png"></a>
                        <?php } else { ?>
                                <a class='btn btn-primary' href="<?= $logoutUrl ?>" onClick='loader()'><img src="Images/logout.png"></a>
                        <?php } ?>
                    </div>

basefacebook.php

public function getLogoutUrl($params = array()) {
        return $this->getUrl(
                        'www', 'logout.php', array_merge(array(
                    'next' => $this->getCurrentUrl(),
                    'access_token' => $this->getAccessToken(),
                                ), $params)
        );
    }

随时询问更多信息。 这个你能帮我吗。 谢谢,

0 个答案:

没有答案