iphone - twitter ios5 集成使用自定义登录名和密码进行自动化

标签 iphone objective-c ios ios5 twitter

我希望我的 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/

相关文章:

ios - UIWebView 源代码

ios - 如何添加 didSet 以查看 UIViewController 的属性?

ios - 获取 ios 中所有可用的 wifi 列表

iphone - sendAsynchronousRequest 在 iPhone 上遇到超时错误

objective-c - 检查 mkmapview 上点击了哪个 map View 注释

ios - Google map URL 方案不适用于 iOS 9

iphone - 如何在不检查操作系统版本的情况下检测 iOS 上的 YouTube 应用程序(或缺少该应用程序)?

iphone - 使用 Interface Builder 创建 UIScrollView 的步骤

objective-c - 删除 WithCompletionHandler 错误

ios - Xamarin/IOS/Azure - 在类型上找不到 'id' 成员