刷新页面时,错误发生在Facebook PHP SDK中

时间:2013-11-20 11:46:02

标签: php facebook sdk

刷新页面时,错误发生在Facebook PHP SDK中。当我再次这样做时,错误消失了。有时它会发生。我该怎么办?:

FacebookApiException Object
(
[result:protected] => Array
    (
        [error] => Array
            (
                [message] => An active access token must be used to query information about the current user.
                [type] => OAuthException
                [code] => 2500
            )

    )

[message:protected] => An active access token must be used to query information about the current user.
[string:private] => 
[code:protected] => 0
[file:protected] => /home2/mahmud/public_html/demo/newfbconnect1/php/sdk3/base_facebook.php
[line:protected] => 1033
[trace:private] => Array
    (
        [0] => Array
            (
                [file] => /home2/mahmud/public_html/demo/newfbconnect1/php/sdk3/base_facebook.php
                [line] => 738
                [function] => throwAPIException
                [class] => BaseFacebook
                [type] => ->
                [args] => Array
                    (
                        [0] => Array
                            (
                                [error] => Array
                                    (
                                        [message] => An active access token must be used to query information about the current user.
                                        [type] => OAuthException
                                        [code] => 2500
                                    )

                            )

                    )

            )

        [1] => Array
            (
                [file] => /home2/mahmud/public_html/demo/newfbconnect1/php/sdk3/base_facebook.php
                [line] => 552
                [function] => _graph
                [class] => BaseFacebook
                [type] => ->
                [args] => Array
                    (
                        [0] => /me
                    )

            )

        [2] => Array
            (
                [file] => /home2/mahmud/public_html/demo/newfbconnect1/php/sdk3/fbmain.php
                [line] => 53
                [function] => api
                [class] => BaseFacebook
                [type] => ->
                [args] => Array
                    (
                        [0] => Array
                            (
                                [0] => Facebook Object
                                    (
                                        [appId:protected] => 113700398662301
                                        [apiSecret:protected] => 6447ce74d35912e7a66d19c5e4da4cc2
                                        [user:protected] => 672961853
                                        [signedRequest:protected] => Array
                                            (
                                                [algorithm] => HMAC-SHA256
                                                [code] => AQDhzPEZ60rCPRScFAB0BauvVmr4mUpQ17lMXpIe6m3w25-KXOi8ioCjBYf-MN-kB1RVkkVeTcQEwWWhNn9lCmLuAeYl2KVC8uChAgR0f3W66wcc-lnrO4Ly_s3U1-IQqZPishvCMHxut4RGcRkUGSQrNOqE2mtxgRgh9X5cjf5oaRiZ3Uq6juTrMDY6lfGWM2IfAO-aVuwlpKwbSRV4L00scSQtOuMpyrmBcb6YcZQbtvVfc4_q-T6iXT1XW3sG_mr6WL1FqFVZtJXoiV_eCPAC6r_3ankf63bZT16Q94tEjmZ6OxS4ZqYURhGABqHEMno
                                                [issued_at] => 1384946308
                                                [user_id] => 672961853
                                            )

                                        [state:protected] => 2057a2ad0adcedfe07231e8ae45197c6
                                        [accessToken:protected] => 113700398662301|6447ce74d35912e7a66d19c5e4da4cc2
                                        [fileUploadSupport:protected] => 
                                    )

                                [1] => _graph
                            )

                        [1] => Array
                            (
                                [0] => /me
                            )

                    )

            )

        [3] => Array
            (
                [file] => /home2/mahmud/public_html/demo/newfbconnect1/php/sdk3/index.php
                [line] => 2
                [args] => Array
                    (
                        [0] => /home2/mahmud/public_html/demo/newfbconnect1/php/sdk3/fbmain.php
                    )

                [function] => include_once
            )

    )

)

1 个答案:

答案 0 :(得分:0)

您使用应用访问令牌(appid | secret)发出请求,您应该使用用户访问令牌发出此请求。

注意:您在自己的问题中发布了自己的应用秘密([accessToken:protected] => 113700398662301 | 6447ce74d35912e7a66d19c5e4da4cc2)。在Facebook开发者中改变你的秘密可能会很好。

相关问题