我正在开发一个向Twitter发送推文的iPhone应用程序。为此,我使用SA_OAuthTwitterEngine + MGTwitterEngine类。如何使用SA_OAuthTwitterEngine从iPhone发布无PIN的推文?
我注册了www.twitter.com/apps的应用程序,并将消费者密钥和消费者密钥传递给控制器,我的代码是这样的。
if(!_engine){
_engine = [[SA_OAuthTwitterEngine alloc] initOAuthWithDelegate:self];
_engine.consumerKey = slPcFUjUh5y1hex0zvEhPg;
_engine.consumerSecret = u6ydovMdP9yeiVqDukVhIzZPgJR9XDPUwfxymzNs;
}
UIViewController *controller = [SA_OAuthTwitterController controllerToEnterCredentialsWithTwitterEngine:_engine delegate:self];
if (controller){
[self presentModalViewController: controller animated: YES];
intTwitterFlag = 1;
}
以前在twitter.com/apps上我选择应用程序类型=客户端,我的应用程序将生成PIN和accessToken。但是,当我更改我的应用程序类型=浏览器时,它无法生成PIN和accessToken。
以前当应用程序类型是客户端我给用户名和密码,然后控制从webview返回到我的应用程序,但现在输入用户名和密码后,它不能dismissModalViewController,但显示选择和复制PIN。
谢谢你的时间和任何帮助,你可以给我!
谢谢你的建议可以给我XAuthTwitterEngine例如SA_OAuthTwitterEngine。 – Apekshit 2011-03-24 07:05:56
https://github.com/aral/MGTwitterEngineDemo显然xAuthTwitterEngine已弃用,因为MGTwitterEngine现在支持xauth和oauth – YNK 2011-03-24 09:15:11
只是一个注释..要使用xauth,您需要联系twitter并要求为您的应用程序激活xauth – YNK 2011-03-24 09:18:34