ParseFacebookUtils - 如何打开Facebook的登录对话框每一次? [英] ParseFacebookUtils - How to Open Facebook Login Dialog every time?

查看:203
本文介绍了ParseFacebookUtils - 如何打开Facebook的登录对话框每一次?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是一样的此线程但答案是不工作了,因为 ParseFacebookUtils.getSession()拥有的被撤销precated

什么是如何注销并刷新,这样下一次Facebook的登录按钮再次出现高速缓存中的替代品。

只是做 ParseUser.logOut()并没有帮助。

下面是我的code登录:

 列表<串GT;权限= Arrays.asList(public_profile,电子邮件);
            ParseFacebookUtils.logInWithReadPermissionsInBackground(这一点,权限,新LogInCallback(){
                @覆盖
                公共无效完成(ParseUser用户,ParseException的错误){
                    Log.v(调试,难道输入LoginCallBack的完成。);
                    如果(用户== NULL){
                        Log.v(调试,嗯哦用户取消了Facebook登录);
                    }否则如果(user.isNew()){
                        Log.v(调试,用户注册并通过Facebook登录!);                    }其他{
                        Log.v(调试,用户登录通过Facebook!);
                    }
                }
            });

我曾尝试与下面的code注销,但它仍然没有帮助。

  //现在叫退出
            ParseUser.logOutInBackground(新LogOutCallback(){
                @覆盖
                公共无效完成(ParseException的E){
                    Log.v(调试,在LogOutCallback() - ()完成 - 我想成功?);
                }
            });


解决方案

我还没有找到一个方法来做到这一点,所以我认为这是没有办法做到这一点,如果用户安装了FB的应用程序。

我觉得它的工作原理是这样的:

如果用户不具有对FB应用则登录总是显示。

如果用户有FB的应用程序,然后在第一时间被要求登录(或权限,我不记得了),那么登录就不再出现,除非从F​​B应用程序用户注销。

My question is same as this thread but the answer in it does not work anymore because ParseFacebookUtils.getSession() has been deprecated.

What is the replacement on how to log out and flush the cache so that next time the Facebook login button appears again.

Just doing ParseUser.logOut() did not help.

Here is my code to login:

List<String> permissions = Arrays.asList("public_profile", "email");
            ParseFacebookUtils.logInWithReadPermissionsInBackground(this, permissions, new LogInCallback() {
                @Override
                public void done(ParseUser user, ParseException err) {
                    Log.v("debug", "Did enter the done for LoginCallBack.");
                    if (user == null) {
                        Log.v("debug", "Uh oh. The user cancelled the Facebook login.");
                    } else if (user.isNew()) {
                        Log.v("debug", "User signed up and logged in through Facebook!");

                    } else {
                        Log.v("debug", "User logged in through Facebook!");
                    }
                }
            });

I have tried to logout with the code below, but it still does not help.

//Now call logout
            ParseUser.logOutInBackground(new LogOutCallback() {
                @Override
                public void done(ParseException e) {
                    Log.v("debug", "in LogOutCallback() - done() - i guess successfully done?");
                }
            });

解决方案

I haven't find a way to do that so i think that there is no way to do that if the user has the FB app installed.

I think it works like this:

If the user doesn't have the FB app then the login is always shown.

If the user has the FB app, then the first time is asked to login (or permissions ,I don't remember), then the login doesn't appear anymore unless the user logouts from FB app.

这篇关于ParseFacebookUtils - 如何打开Facebook的登录对话框每一次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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