我希望我的 ios5 应用程序能够发布推文。 我正在使用 ReyWenderlich 教程中的标准代码:
-(void)postOnTwitter:(id)sender
{
NSLog(@"postOnTwitter: called");
if ([TWTweetComposeViewController canSendTweet])
{
TWTweetComposeViewController *tweetSheet =
[[TWTweetComposeViewController alloc] init];
[tweetSheet setInitialText:@"Tweeting from iOS 5 By Tutorials! :)"];
[self presentModalViewController:tweetSheet animated:YES];
}
else
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Sorry" message:@"You can't send a tweet right now, make sure your device has an internet connection and you have at least one Twitter account setup" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
};
}
一切都很好,如果我的设备上有 Twitter 帐户,此代码将起作用。 但!我需要在应用程序的信息屏幕中输入 Twitter 登录名和密码。 因此,我需要执行此操作,但使用我的自定义登录数据,而不是通过从 Twitter 帐户提取的登录数据。对于前。我需要相同的推文,但登录名:123 和密码:qwerty。
请帮帮我,该怎么办?
最佳答案
如果您使用的是 ios5,那么像电子邮件这样的 Twitter 框架不提供此功能。因此,如果您想要自定义登录对话框,请使用 S_OAuth。您可以点击以下链接:http://www.dotnetexpertsforum.com/how-to-integrate-twitter-in-your-iphone-t1836.html
关于iphone - twitter ios5 集成使用自定义登录名和密码进行自动化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9062334/