ACMSocialAuth 1.0

ACMSocialAuth 1.0

burakcolakappcent 维护。



 
依赖项
FBSDKCoreKit= 16.3.1
FBSDKLoginKit= 16.3.1
GoogleSignIn= 7.0.0
 

  • burak

ACMSocialAuth

ACMSocialAuth 是一个社交认证库,帮助开发者轻松实现社交认证。

安装

通过 Cocoapods

pod 'ACMSocialAuth'

通过 SPM,添加新的包,以下为搜索 URL

https://github.com/AppcentMobile/ACMSocialAuth

基本用法

  • 添加应用代理帮助方法

Facebook

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
  ACMSocialAuth.shared.application(with: .facebook, application: application, didFinishLaunchingWithOptions: launchOptions)
  return true
}

Google

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)
}

许可