Facebook 应用程序权限

问题描述 投票:0回答:1

我使用 Action-script 3 在 Flash 中开发了 Facebook 应用程序。该应用程序运行良好。我用 JavaScript 开发了 Facebook 登录和身份验证。问题是用户没有登录 Facebook,应用程序可以正常工作,提供用户登录面板和应用程序权限面板,并将所需的内容发布到用户墙上,但如果用户已经登录,则 JavaScript 不会要求 Facebook应用程序权限,因此该应用程序不会发布在用户墙上。我的 JavaScript 代码是

<script type="text/javascript">
    var APP_ID = "xxxxxxxxxxxxxxx";
    var REDIRECT_URI = "http://apps.facebook.com/engel-tanimiyorum/";
    var PERMS = 'publish_stream , email, user_birthday'; //comma separated list of extended permissions

    function init()
    {
        FB.init({appId:APP_ID, status: true, cookie: true, oauth: true});
        FB.getLoginStatus(handleLoginStatus);
    }

    function handleLoginStatus(response)
    {
        if (response.authResponse && response.status=="connected")
        {
            
            //Show the SWF
            $('#ConnectDemo').append('<h1>You need at least Flash Player 9.0 to view this page.</h1>');
            swfobject.embedSWF("index.swf",
                "ConnectDemo", "803", "516", "9.0", null, null, null, {name:"ConnectDemo"});

        }
        else
        {
            var params = window.location.toString().slice(window.location.toString().indexOf('?'));
            top.location = 'http://graph.facebook.com/oauth/authorize?client_id='
                +APP_ID
                +'&scope='+PERMS
                +'&redirect_uri=' + REDIRECT_URI
                + params;
                
                

        }
        
        
    }
    $(init);
</script>
javascript facebook flash
1个回答
0
投票

代替你的 var PERMS = 'publish_stream,电子邮件,user_birthday';

我确实认为它应该以数组的形式表示,然后你会列出你的权限。
它对我有用,所以我认为它应该看起来像这样:

public var PERMS:Array = ["publish_stream","email","user_birthday"];

此外,不公开变量也可能是问题所在。

另外,据我所知,你没有任何按钮,或文本输入?

如果没有,您需要创建它们。然后有一个点击处理程序,当文本输入中有文本时,它将激活一个点击处理程序,然后该处理程序将转到提交帖子处理程序,然后该处理程序转到获取状态处理程序,该处理程序将向您显示您创建的新状态。我可能说的都是错的。毕竟,我的应用程序没有使用 Java。但对我来说这似乎是合乎逻辑的,那就是你会做的。

© www.soinside.com 2019 - 2024. All rights reserved.