views:

1631

answers:

3

I'm looking for a simple example of how to send a Tweet from an iphone app. I've seen some very complex methods, but it can't be that difficult. I have registered the app with twitter, so I have the key & secret. Just need to know where to put these so I can send a status update and have it say "sent from MyApp".

+1  A: 

MGTwitterEngine! Don't reinvent the wheel. Use either this (it's fantastically easy to use) or the CocoaRest library.

Dave DeLong
I've tried to use that, but it doesn't support OAuth. Every tweet you send says "sent from MGTwitterEngine". If it's possible to use OAuth with it I'd love to know how.
sol
Have you figured this out? I thought that the latest version (1.0.8) is supposed to allow for this but after getting an oAuth token from Twitter and passing it in as [twitterEngine setClientName:@"MyAppName" version:@"1.0" URL:@"http://www.myapp.com" token:@"myTwitterSuppliedPublicKey"], the string you see becomes 'from web', not the client name provided.
Alexi Groove
+2  A: 

If you're using MGTwitterEngine you need to call the following method on your instance of MGTwitterEngine:

- (void)setClientName:(NSString *)name version:(NSString *)version URL:(NSString *)url token:(NSString *)token;

You might want to check out the version that explicitly supports OAuth.

Nathan de Vries
+5  A: 

http://github.com/bengottlieb/Twitter-OAuth-iPhone/tree/master

James Hall
I second this :-)
Ben Gottlieb
This worked great for me. (Thanks, Ben!)
Justin Gallagher