简体   繁体   English

Twitter登录iphone应用程序

[英]Twitter login in iphone application

I am developing a iPhone application in which user has to login through social networks ie Facebook,Twitter,GooglePlus. 我正在开发一个iPhone应用程序,用户必须通过社交网络登录,即Facebook,Twitter,GooglePlus。

The login functionality is just like this app : https://itunes.apple.com/in/app/fancy/id407324335?mt=8 登录功能就像这个应用程序: https//itunes.apple.com/in/app/fancy/id407324335?mt = 8

I have logged in via facebook and its working fine. 我已经通过Facebook登录并且工作正常。 But I don't how to get the user details from the twitter and google plus. 但我不知道如何从twitter和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. 要登录Twitter, https ://dev.twitter.com/docs/ios提供的文档非常全面。

There is a sample project with a few functionalities implemented in this project. 有一个示例项目,在该项目中实现了一些功能。

https://github.com/lucascorrea/SCTwitter https://github.com/lucascorrea/SCTwitter

As for Google Plus, I don't think there is any better resource than this one. 至于Google Plus,我认为没有比这更好的资源了。

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

Here is how to retrieve user details with the STTwitter library: 以下是如何使用STTwitter库检索用户详细信息:

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

[twitter verifyCredentialsWithSuccessBlock:^(NSString *bearerToken) {

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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