如何使用解析注销/更改Twitter帐户 [英] How to logout/change Twitter account with Parse

查看:1347
本文介绍了如何使用解析注销/更改Twitter帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何登录:

ParseTwitterUtils.logIn(loginView.getCurrentContext(), new LogInCallback() {
        @Override
        public void done(ParseUser parseUser, ParseException e) {
            if (e == null) {
                String welcomeMessage = "";
                if (parseUser.isNew()) {
                    welcomeMessage = "Hello new guy!";
                } else {
                    welcomeMessage = "Welcome back!";
                }
                loginView.showLoginSuccess(parseUser, welcomeMessage);
            } else {
                String errorMessage = "Seems we have a problem : " + e.getLocalizedMessage();
                loginView.showLoginFail(errorMessage);
            }
        }
    });

并注销:

ParseUser.logOutInBackground(new LogOutCallback() {
        @Override
        public void done(ParseException e) {
            if (e == null) {
                homeView.goLogin(true, "See you soon");
            } else {
                homeView.goLogin(false, "Error detected : " + e.getLocalizedMessage());
            }
        }
    });

但是当我想再次登录时,我没有提示我选择帐户的警报对话框(由于模拟器上未安装Twitter应用,所以我使用Webview).

But when i want to log in again, i don't have the alert dialog asking me to choose accounts (i use the webview since Twitter app is not installed on the emulator).

如何使用Twitter登录真正从Parse注销?

How to truly logout from Parse using Twitter login ?

推荐答案

在iOS中,您可以在PFOauth1FlowDialog.m中修改Parse的源代码.

In iOS, you can revise the source code of Parse in PFOauth1FlowDialog.m

- (void)loadURL:(NSURL *)url queryParameters:(NSDictionary *)parameters   {
    NSMutableDictionary *_parameter = [[NSMutableDictionary alloc] init];
    [_parameter setObject:@"true" forKey:@"force_login"];
    [_parameter addEntriesFromDictionary:parameters];
    _loadingURL = [[self class] _urlFromBaseURL:url queryParameters:_parameter];
    NSURLRequest *request = [NSURLRequest requestWithURL:_loadingURL];
    [_webView loadRequest:request];
}

然后一切都应该正常工作,并且在Android中也应该工作.

Then everything should work fine, And this should also work in Android.

这篇关于如何使用解析注销/更改Twitter帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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