GenAuth DocsDocuments
Concepts
User Guide
Development Integration
AgentAuth
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Concepts
User Guide
Development Integration
AgentAuth
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Old version
  • Single Page Web Application

  • Mobile and Client Applications

    • Android

    • C#

    • Flutter

    • iOS

      • Quick Start
      • Hosted Pages
      • Components

      • APIs

      • Social Login

        • 微信登录
        • 企业微信登录
        • 飞书登录
        • 苹果帐号登录
        • 手机号一键登录
      • Typical Scenarios

      • Private Deployment
    • React Native
  • Standard Web Application

  • Framework Integration

  • Others

  1. Development Integration
  2. /
  3. Mobile and Client Applications
  4. /
  5. iOS
  6. /
  7. Social Login
  8. /
  9. 手机号一键登录

¶ 手机号一键登录

Update time: 2025-07-23 07:34:21
Edit

¶ 接入步骤

¶ 添加依赖

Guard-iOS-binary 依赖于 Guard 组件(Version 1.2.4 之后)

  • 在 swift package 搜索栏输入:https://github.com/Authing/authing-binary

  • 依赖规则选择 Up to Next Major Version 1.0.0

  • Add Package 后勾选 OneAuth


¶ 在应用启动的时候设置:

import Guard
import OneAuth
GenAuth.start(<#GenAuth AppId#>);
OneAuth.register(businessId:<#your_businessId#>)

¶ 发起认证

OneAuth.start(self) { code, message, userInfo in
    if (code == 200) {
        //userInfo
    }
}
  • 若需要自定义 UI,首先参考 易盾文档 (opens new window) 生成 NTESQuickLoginModel 对象,然后调用:
let model: NTESQuickLoginModel = NTESQuickLoginModel()
OneAuth.start(self, model: model) { code, message, userInfo in
    if (code == 200) {
        //userInfo
    }
}
  • 若想基于易盾自己实现一键登录流程,在拿到 token 和 access token 后,可以调用:
func loginByOneAuth(token: String, accessToken: String, completion: @escaping(Int, String?, UserInfo?) -> Void) {}

参数

  • token 运营商返回
  • accessToken 运营商返回

示例

AuthClient().loginByOneAuth(token: <#Token#>, accessToken: <#AccessToken#>) { code, message, userInfo in
    //userInfo
}
Previous article: 苹果帐号登录 Next article: Typical Scenarios
  • 接入步骤

User identity management

Integrated third-party login
Customized authentication process

Enterprise internal management

Single sign-on
Multi-factor authentication
Permission management

Developer

Development Documentation
GitHub (opens new window)

Company

official@genauth.ai
16th Floor, Building B, Beichen Century Center, Chaoyang District, Beijing (Total)
Room 406, 4th Floor, Block B, No. 200, Tianfu Fifth Street, High-tech Zone, Chengdu (Branch)

© Beijing Steamory Technology Co., Ltd.