CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

DryGoogle-iOS 1.0.0

DryGoogle-iOS 1.0.0

Maintained by duanruiying.



  • By
  • duanruiying

DryGoogle-iOS

iOS: Facebbok功能集成简化(登录)

Prerequisites

  • iOS 10.0+
  • ObjC、Swift

Installation

  • pod 'DryGoogle-iOS'

App工程配置

  • 为URL Types 添加回调scheme(identifier:""、URL Schemes:"com.googleusercontent.apps.+AppID")

Features

SDK配置

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [DryGoogle registerSDK:@""];
    return YES;
}

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
    [DryGoogle handleOpenURL:url];
    return YES;
}

登录、获取用户信息

/// 登录
[DryGoogle login:^(DryGoogleCode code, DryGoogleUser * _Nullable user) {
    NSLog(@"%ld", (long)code);

    /// 获取用头像数据
    [DryGoogle userAvatar:50 completion:^(UIImage * _Nullable img, NSURL * _Nullable url) {
        NSLog(@"%@", url);
    }];
}];