简体   繁体   中英

Twitter login in iphone application

I am developing a iPhone application in which user has to login through social networks ie Facebook,Twitter,GooglePlus.

The login functionality is just like this app : https://itunes.apple.com/in/app/fancy/id407324335?mt=8

I have logged in via facebook and its working fine. But I don't how to get the user details from the twitter and google plus.

Please provide me some sample source.

Thanks in advance

To login to Twitter, the documentation provided here https://dev.twitter.com/docs/ios is pretty comprehensive.

There is a sample project with a few functionalities implemented in this project.

https://github.com/lucascorrea/SCTwitter

As for Google Plus, I don't think there is any better resource than this one.

https://developers.google.com/+/mobile/ios/sign-in

Here is how to retrieve user details with the STTwitter library:

STTwitterAPI *twitter = [STTwitterAPI twitterAPIAppOnlyWithConsumerKey:@"..." consumerSecret:@"..."];

[twitter verifyCredentialsWithSuccessBlock:^(NSString *bearerToken) {

    [twitter getUserInformationFor:@"twitterapi" successBlock:^(NSDictionary *user) {
        NSLog(@"%@", user);
    } errorBlock:^(NSError *error) {
        // ...
    }];

} errorBlock:^(NSError *error) {
    // ...
}];

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