I am trying to open the Twitter app from within my app in iOS 5, but it won’t open. Any help would be appreciated, I have included the code I am using below.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=TWITTER"]];
Please help me, and thanks in advance!
Do you want to launch the Twitter app, Or just send tweets from within your app? I believe that the code you are showing above is to Launch Twitters preferences in your settings app… Which I also believe has been disallowed in 5.1
If you are looking to add Twitter integration to your app Apple provides great sample code to show you how to use Twitter with the built in Twitter frameworks in iOS 5.
Now I recommend you download this sample code and see what else is required to send a tweet (like checking CanTweetStatus) but I’m attaching a basic idea of how to send a tweet in this post.
https://developer.apple.com/library/ios/#samplecode/Tweeting/Introduction/Intro.html#//apple_ref/doc/uid/DTS40011191
Good Luck!