问题描述
我使用Twitter的结构创建了一个基本的应用程序,允许用户在我的应用程序中发推文并提供使用Twitter登录。每件事情都是我想要的。
I have made a basic app using Twitter's fabric that allows user to tweet within my app and Provide Login With Twitter.Every things works a I Wanted.
如果用户没有登录到Twitter,我的应用程序允许他登录,如果他登录然后直接允许他发推文。
If the user doesn't logged in to twitter my app allows him to login and if he is login then directly allows him to tweet.
正如我在许多应用程序中看到的,我可以从应用程序中删除我已签名的帐户。而且我无法获得任何帮助我实现此目的的方法。我希望允许用户在他/她想要的时候在我的应用程序中从Twitter注销。
As I saw in many Apps I Can Remove my signed account from the app.And I am not able to get any method that help me to achieve this. I want to allow user to logout from twitter within my app whenever he/She wants.
我用谷歌搜索但我找不到任何东西
I googled but i doesn't find anything
这是我的代码:
- (IBAction)LogOut:(id)sender
{
[[Twitter sharedInstance]logOut];
}
- (IBAction)LogMeIn:(id)sender
{
[[Twitter sharedInstance] logInWithCompletion:^
(TWTRSession *session, NSError *error) {
if (session) {
NSLog(@"signed in as %@", [session userName]);
[LoginButton setTitle:@"LogOut" forState:normal];
} else {
NSLog(@"error: %@", [error localizedDescription]);
}
}];
}
推荐答案
更新:2016年5月 - 框架已经改变,所以这个答案已经不再适用了。
UPDATE: May 2016 - Framework has changed so this answer is no longer relevant.
看到这个答案:
和这个回答:
。
这篇关于如何让用户从twitter fabric ios注销的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!