ios5.0でtwitterフレームワークが追加されたので、私はそのクラスを使用していますTWTweetComposeViewController
if([TWTweetComposeViewController canSendTweet])
{
NSLog(@"can send tweet");
}
else{
NSString *message = @"The application cannot send a tweet at the moment. This is because it cannot reach Twitter or you don't have a Twitter account associated with this device.";
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Oops" message:message delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil];
[alertView show];
}
このステップでは、ユーザーにTwitterのログインページを表示する必要があります。そのため、ユーザーを設定にリダイレクトしてユーザーにログインする必要があるかどうか混乱していますか?
はいの場合、このコードは機能していません
NSURL *twitterURL = [NSURL URLWithString:@"prefs:root=TWITTER"];
[[UIApplication sharedApplication] openURL:twitterURL];
また、これがios6で機能しない場所をいくつか読んだことがあります。では、ユーザーに少しの間ログインさせ、ツイートを直接送信しないようにするにはどうすればよいですか。今、私はユーザーにログインさせたいだけです。
私もこの質問を参照します それはios6でうまく機能していますが、その場合、私はios5.1をどのように処理しますか?
どんな助けでもありがたいです....