Facebook上的Andr​​oid SDK - 岗上墙对话框立即消失 [英] Android Facebook sdk - post on wall dialog disappears immediately

查看:86
本文介绍了Facebook上的Andr​​oid SDK - 岗上墙对话框立即消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Facebook的Andr​​oid SDK中,通过添加应用程序ID到它运行在模拟器其提供的示例例子。

I am using Facebook android SDK, running its provided sample example in emulator by adding app id into it.

问题是我正确我能登录,但是当我在华尔街邮报按钮点击,Facebook上的WebView对话框打开类似的标题为后华尔街登录。此对话框几秒钟后立即消失。

The problem is i am able login properly but when i click on "Wall Post" button, Facebook webview dialog opens similar to login with title "Post on Wall". This dialog disappears immediately after few seconds.

可能是什么问题,我要去的地方错了。

what could be the issue, where i am going wrong.

编辑1:
它实际上与模拟器有问题。我已经在其他模拟器的工作正常进行了测试。但是现在成功的墙后FB的WebView对话框后,仿真器被关闭并返回到应用程序,但在设备没有。该对话框保持有显示成功后ID黑屏

EDIT 1: Its actually a problem with the emulator. I have tested it in other emulator its works fine. But now in emulator after successful wall post FB webview dialog gets closed and return back to app but in device it doesn't. The dialog stays there showing blank screen with success post id

编辑2:
我也注意到这个对话框消失,问题是如何对2.1版(测试仿真器)。但是,它的工作原理罚款V2.2及以上(测试仿真器和设备)

EDIT 2: I also noticed this dialog disappear issue is getting on v2.1(Tested on emulator). But it works fine on v2.2 and above(Tested on emulator and device)

推荐答案

它不是与模拟器的问题。但它的一个问题,因为你必须在仿真器上安装本地facebookapp。

Its not the issue with the Emulator. But its a Issue because you have install the native facebookapp in that emulator.

我收到了同样的问题,现在我已经解决它。

I am getting the same issue and now i have solve it.

您需要做的是:

刚去的Facebook SDK项目。然后去Facebook.java

Just go to facebook sdk project. then go to Facebook.java

现在在这里你会得到一个方法的授权,如:

Now here you will get one Method for the Authorization like:

 public void authorize(Activity activity, String[] permissions,
        int activityCode, final DialogListener listener) {

    boolean singleSignOnStarted = false;

    mAuthDialogListener = listener;

    THIS CODE IS EDITED BY SHREYASH FOR NOT ALLOW THE DEFAULT FACEBOOK APP
    // Prefer single sign-on, where available.
    if (activityCode >= 0) {
        singleSignOnStarted = startSingleSignOn(activity, mAppId,
                permissions, activityCode);
    }
    // Otherwise fall back to traditional dialog.
    if (!singleSignOnStarted) {
        startDialogAuth(activity, permissions);
    }
}

只需更换上述本下面的一个:

Just Replace the above with this below one:

    public void authorize(Activity activity, String[] permissions,
            int activityCode, final DialogListener listener) {

        boolean singleSignOnStarted = false;

        mAuthDialogListener = listener;

//        THIS CODE IS EDITED FOR NOT ALLOW THE DEFAULT FACEBOOK APP
//        // Prefer single sign-on, where available.
//        if (activityCode >= 0) {
//            singleSignOnStarted = startSingleSignOn(activity, mAppId,
//                    permissions, activityCode);
//        }
//        // Otherwise fall back to traditional dialog.
//        if (!singleSignOnStarted) {
            startDialogAuth(activity, permissions);
//        }
    }

这将切切实实解决您的问题。
如果没有,那么让我知道。

It will surly solve your issue. If not then let me know.

享受。

:)

这篇关于Facebook上的Andr​​oid SDK - 岗上墙对话框立即消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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