i’m trying to implement sharekit twitter authentication on my app.
I already installed sharekit on my app. And this is my current code on my “Log in page”
- (void)viewDidLoad {
[super viewDidLoad];
NSURL *url = [NSURL URLWithString:@"http://www.test.com"];
SHKItem *item = [SHKItem URL:url title:@"A title"];
}
-(IBAction)SignInTwitter:(id)sender{
[SHKTwitter shareItem:item];
}
with this, after tapping SignInTwitter, it redirects me to the twitter log in form, then after a successful log in, it returns me to the log in page of my app.
I’m pretty sure this is not the right way to do, is there any way without using shareItem method?
What i want is when the user taps SignInTwitter, it makes the user log in to his/her twitter account, and if successful it will redirect the user to the main page of the app, not back on the log in page.
Also, is it possible to acquire the twitter username of the account that is logged in?
Thanks!
if you plan to deploy on iOS5+ you might use native Accounts framework and get what you want from there – this way you do not need ShareKit at all. Great info about this in in last year’s WWDC videos.
If, for whatever reason you need ShareKit:
[[[SHKTwitter alloc] init] authorize];