ACMSocialAuth
ACMSocialAuth 是一个社交认证库,帮助开发者轻松实现社交认证。
安装
通过 Cocoapods
pod 'ACMSocialAuth'
通过 SPM,添加新的包,以下为搜索 URL
https://github.com/AppcentMobile/ACMSocialAuth
基本用法
- 添加应用代理帮助方法
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
ACMSocialAuth.shared.application(with: .facebook, application: application, didFinishLaunchingWithOptions: launchOptions)
return true
}
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
ACMSocialAuth.shared.application(with: .google, app: app, open: url, options: options)
return true
}
- 使用受支持的提供者 [Apple, Facebook, Google] 和状态 [登录,登出] 调用社交授权请求
ACMSocialAuth.shared.login(with: .google, state: .login) { model in
print(model)
} onError: { error in
print(error)
}
许可
- Apache License 2.0 (LICENCE-Apache-2.0 或 https://open-source.org.cn/license/apache-2.0/)