TwitterAgent Tutorial : Tweet from iPhone app in one line code with auto tinyURL
** For sample project, see the comments at the end of this post **
Perhaps, you have used the FacebookAgent in your apps. I gratefully thank the fellows from iphonedevsdk.com and other iPhone developers who mailed me saying the class helped them. These are actual inspiration of sharing code with all.
Now, I would like to share my TwitterAgent class with you. Using TwitterAgent you can now integrate twitter in your iPhone app seamlessly. Additionally, you can also specify a URL and can make it tinyURL on the fly just passing an extra parameter!
Here are the steps:
1. Download TwitterAgent and BusyAgent and add them into your project.
2. Import TwitterAgent.h in the file where we want to use
3. Now call any of these function, they are self explanatory!
[[TwitterAgent defaultAgent] twit ]; [[TwitterAgent defaultAgent] twit:@"Search with google!" ]; [[TwitterAgent defaultAgent] twit:@"Search with google!" withLink:@"http://www.google.com" makeTiny:NO]; [[TwitterAgent defaultAgent] twit:@"Search with google!" withLink:@"http://www.google.com" makeTiny:YES];
Screenshots:
You only need to login once in one session. Login information will be saved to the device and will be used next time the application starts.
[[TwitterAgent defaultAgent] twit];
[[TwitterAgent defaultAgent] twit:@"Search with google!"];
[[TwitterAgent defaultAgent] twit:@"Search with google!" withLink:@"http://www.google.com" makeTiny:NO];
[[TwitterAgent defaultAgent] twit:@"Search with google!" withLink:@"http://www.google.com" makeTiny:YES];
Hope it will come into your help. Cheers!
-
bunnyhero
-
Shaikh Sonny Aman
-
Jackie
-
Vic
-
Shaikh Sonny Aman
-
Rob
-
Shaikh Sonny Aman
-
Rob
-
leo888
-
Shaikh Sonny Aman
-
uriash
-
Shaikh Sonny Aman
-
uriash
-
Shaikh Sonny Aman
-
exe
-
Shaikh Sonny Aman
-
Alon Ezer
-
Shaikh Sonny Aman
-
Shaikh Sonny Aman
-
Jabroni
-
Shaikh Sonny Aman




(4.50 out of 5)
(4.17 out of 5)