我使用Twitter的结构制作了一个基本的应用程序,该应用程序允许用户在我的应用程序中进行鸣叫并提供Twitter登录。
我的应用程序如何运作
如果用户未登录Twitter,我的应用程序将允许他登录,如果他已经登录,则直接允许他发推文。
现在大事了
正如我在许多应用程序中看到的那样,我可以从该应用程序中删除已签名的帐户,而且我无法找到任何方法来帮助实现这一目标。我想允许用户随时在我的应用程序中从Twitter注销。
我用谷歌搜索,但没有找到任何东西
这是我的代码:
- (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月-框架已更改,因此此答案不再适用。
请参阅以下答案:https : //stackoverflow.com/a/35765833/940709和此答案:https : //stackoverflow.com/a/30916904/940709。
[[[Twitter sharedInstance] sessionStore] logOutUserID:USERID];
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句