ios - Twitter login in browser when no app available -
i'm building sample authenticate twitter, went throw documentation here :http://docs.fabric.io/ios/twitter/authentication.html
after implementing login button access accounts in phone,if there no account doesn't go browser , login instead. facebook or google+.
this have in viewdidload
:
twtrloginbutton* loginbutton = [twtrloginbutton buttonwithlogincompletion:^(twtrsession* session, nserror* error) { if (session) { self.username.text = [nsstring stringwithformat:@"%@",[session username]]; self.userid.text = [nsstring stringwithformat:@"%@",[session userid]]; } else { nslog(@"error: %@", [error localizeddescription]); } }]; loginbutton.center = cgpointmake(190.0, 250.0); [self.view addsubview:loginbutton]; [[twitter sharedinstance] loginwithcompletion:^(twtrsession *session, nserror *error) { if (session) { self.username.text = [nsstring stringwithformat:@"%@",[session username]]; self.userid.text = [nsstring stringwithformat:@"%@",[session userid]]; } else { nslog(@"error: %@", [error localizeddescription]); } }];
and in appdelegate
:
[[twitter sharedinstance] startwithconsumerkey:@"something" consumersecret:@"another thing"]; [fabric with:@[[twitter sharedinstance]]];
how possible allow signing-in using browser ?
i've added callback url
in twitter application management under settings tab , works without deleting anything.
Comments
Post a Comment