1.集成安装包:
pod 'GoogleSignIn' #google 社会化分享
3.在google的API库,找到:google+API,
4.创建凭据
5.查看凭证信息,取到客户端 ID和iOS 网址架构
6.将iOS 网址架构配置进URLTypes
7.集成进项目
#import "SSGoogleTool.h"
@implementation SSGoogleTool
+(void)start{
[GIDSignIn sharedInstance].clientID = @"客户端ID";
}
+(void)signInWithPresentingViewController:(UIViewController *)presentingViewController
delegate:(id<GIDSignInDelegate>)delegate{
GIDSignIn*signIn = [GIDSignIn sharedInstance];
signIn.presentingViewController = presentingViewController;
signIn.delegate = delegate;
[signIn signIn];
}
@end