简体   繁体   中英

How to open twitter login page from iOS application

I am developing an twitter application in which i have to create login page in application just like Facebook login dialog come.I tried STTwitter using this we have to add the twitter username and password in settings.Is there is any way to login twitter from iOS application.

This is my code

    - (IBAction)loginWithiOSAction:(id)sender {

    self.twitter = [STTwitterAPI twitterAPIOSWithFirstAccount];

    _loginStatusLabel.text = @"Trying to login with iOS...";
    _loginStatusLabel.text = @"";

    [_twitter verifyCredentialsWithSuccessBlock:^(NSString *username) {

        _loginStatusLabel.text = username;

    } errorBlock:^(NSError *error) {
        _loginStatusLabel.text = [error localizedDescription];
    }];

}

No, you don't need to add the Twitter credentials in iOS Settings.

STTwitter comes with a project named STTwitterDemoiOS .

This project shows how to login through the Twitter login page.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM