Google 第三方登录(iOS)

1.集成安装包:

pod 'GoogleSignIn' #google 社会化分享

2.创建应用:https://console.developers.google.com/apis/library?project=pelagic-script-297806&folder&organizationId

3.在google的API库,找到:google+API,


Google 第三方登录(iOS)_第1张图片
image.png

4.创建凭据


Google 第三方登录(iOS)_第2张图片
image.png

5.查看凭证信息,取到客户端 ID和iOS 网址架构


Google 第三方登录(iOS)_第3张图片
image.png
Google 第三方登录(iOS)_第4张图片
image.png

6.将iOS 网址架构配置进URLTypes


Google 第三方登录(iOS)_第5张图片
image.png

7.集成进项目

#import "SSGoogleTool.h"

@implementation SSGoogleTool

+(void)start{
    [GIDSignIn sharedInstance].clientID = @"客户端ID";
}

+(void)signInWithPresentingViewController:(UIViewController *)presentingViewController
                                 delegate:(id)delegate{
    GIDSignIn*signIn = [GIDSignIn sharedInstance];
    signIn.presentingViewController = presentingViewController;
    signIn.delegate = delegate;
    [signIn signIn];
}

@end

你可能感兴趣的:(Google 第三方登录(iOS))