PhoneGap; FB Connect插件(Android操作系统):每个帖子重新授权FB应用 [英] PhoneGap; FB Connect Plugin (Android OS): Re-Authorizing FB App every post

查看:157
本文介绍了PhoneGap; FB Connect插件(Android操作系统):每个帖子重新授权FB应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用PhoneGap:Build和FB Connect Plugin创建了一个Android应用。该应用程序工作正常和FB插件,也。只有一个微小的东西还没有工作。我不会在提交一个按钮工作后发布的东西。第一次,用户必须登录和授予FB应用程序的权限,他们的帖子发布。这是它应该的方式。而下一次用户提交的帖子应该发布没有整个权限的事情,但是这不工作! FB会显示一条消息,例如您已向应用授予权限...。并且用户必须在帖子发布之前按下Ok按钮?

I created an Android App with PhoneGap:Build and the FB Connect Plugin. The app works fine and the FB Plugin, too. Just one tiny thing isn't working yet. I won't to post something after submiting a button which works, too. At the first time the user has to login and grant permissions to the FB App and them the post is published. That's the way it should be. And the next time the user submits the post should be published without the whole permission thing but this isn't working!? FB shows a message like "You already granted permission ... to the app." and the user has to push the Ok-button before the post is published???

因为我还没有找到我的问题的答案,也许我只是做在我的FB Javascript调用错误?这是当前的代码:

Because I still haven't found an answer for my question, maybe I just do something wrong in my FB Javascript call? Here is the current code:

FB.login(function(response) {
    if (response.authResponse) {

        var data = {
            ...
        }
        FB.api('/me/feed', 'post', data, function(response) {
            // Callback
            if (!response || response.error) {
                // ERROR

            }
        });

    } else {
        // ERROR

    }

}, {scope: 'publish_stream'});

好吧,为了更好地理解这里的屏幕的图片,每个帖子apear:
< a href =http://i.stack.imgur.com/bZrde.png =nofollow> http://i.stack.imgur.com/bZrde.png

Well, to better understanding here a picture of the screen that apears every post: http://i.stack.imgur.com/bZrde.png

Thx,
Daniel

Thx, Daniel

推荐答案

我认为这个问题的解决方案不包括每次你想要发布的东西的登录请求。您可以检查登录状态和/或权限,而无需执行登录。然后,如果用户未登录,请先执行登录,然后返回到新的帖子操作。

I think the solution to this problem is to not include the login request every time you want to post something. You can check login status, and/or permissions, without performing a login. Then, if the user is not logged in, do the login first, and come back to the new post action.

这篇关于PhoneGap; FB Connect插件(Android操作系统):每个帖子重新授权FB应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆