How can you direct a user to add their Twitter account to Twitter settings using the Twitter.framework function?

On iOS5, can I request and direct the user to the Twitter.app settings area so that they can add their Twitter account to the phone? If so, how do you do it?

As a job, I can direct them to open Settings.app, but more on that.

+5
source share
4 answers

I found the solution in another SO post:

Open Twitter settings in settings application

Short answer:

[[UIApplication sharedApplication] openURL: [NSURL URLWithString: @ "prefs: root = TWITTER"]];

+1
source

, twitter , , :

if([TWTweetComposeViewController canSendTweet]){ 

   ...

}else{
    NSString *tweet = [NSString stringWithFormat:@"http://twitter.com/intent/tweet?source=SourceApp&text=%@", [tweetText substringToIndex:140]]; 
    tweet = [tweet stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSURL *webLink = [NSURL URLWithString:tweet];
    [[UIApplication sharedApplication] openURL:webLink];

}
+2

Tweetsheet , tweetsheet , twitter , AlertView, Twitter http://dl.dropbox.com/u/47726728/tweet%20sheet.swf jing .

0

As noted in a comment here, now this is the default behavior in iOS with 5.1. Just open one of these widgets, and if the user does not enter an account in iOS, the user will be prompted to do so.

0
source

All Articles