{"id":21518192,"url":"https://github.com/ucloud/unvs-ios-sdk","last_synced_at":"2025-10-25T21:42:45.879Z","repository":{"id":81009997,"uuid":"444388101","full_name":"ucloud/unvs-ios-sdk","owner":"ucloud","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-26T02:51:33.000Z","size":2848,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-05-26T19:05:49.240Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ucloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-04T11:08:16.000Z","updated_at":"2022-01-04T11:35:13.000Z","dependencies_parsed_at":"2025-03-17T16:42:03.720Z","dependency_job_id":"707f5847-a500-49fb-aa55-fb529a2e4387","html_url":"https://github.com/ucloud/unvs-ios-sdk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucloud%2Funvs-ios-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucloud%2Funvs-ios-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucloud%2Funvs-ios-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucloud%2Funvs-ios-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ucloud","download_url":"https://codeload.github.com/ucloud/unvs-ios-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucloud%2Funvs-ios-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":258338802,"owners_count":22685539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T00:50:29.422Z","updated_at":"2025-10-25T21:42:45.780Z","avatar_url":"https://github.com/ucloud.png","language":"Objective-C","readme":"\n# UCloud号码认证 iOS SDK 接入文档\n\n| 日期 | 版本 | 说明 |\n| --- | --- | --- |\n| 2021-10-29 | 1.0.0 | UCloud号码认证iOS SDK，支持一键登录、本机号码检测。 |\n\n## 一、目录\n  - [一、目录](#一、目录)\n  - [二、接入说明](#二、接入说明)\n  - [三、SDK接口说明](#三、sdk接口说明)\n      - [2.0 初始化SDK](#2-0初始化-sdk)\n      - [2.1 预加载授权页（取号）](#2-1预加载授权页（取号）)\n      - [2.2 加载授权页](#2-2加载授权页)\n      - [2.3 关闭授权页](#2-3关闭授权页)\n      - [2.4 本机号码校验Token获取](#2-4本机号码校验-token获取)\n      - [2.5 日志打印](#2-5日志打印)\n      - [2.6 超时设置](#2-6超时设置)\n      - [2.7 运营商类型](#2-7运营商类型)\n      - [2.8 连接网络类型](#2-8连接网络类型)\n      - [2.9 SDK版本](#2-9-sdk版本)\n  - [四、其他注意事项](#四、其他注意事项)\n\n## 二、接入说明\n\n开发环境：\n* 最低部署版本：iOS 9.0及以上。\n* Xcode开发工具：12.0及以上。\n\n集成方式：\n\n* 将`UnvsSDK.xcframework`拖拽到Xcode工程内（需要勾选Copy items if needed选项）。\n* 点击项目target -\u003e General -\u003e Frameworks,Libraries,and Embedded Content -\u003e UnvsSDK.xcframework，在Embed选项下，选择`Embed \u0026 Sign`。\n\n-------\n\n**一键登录使用步骤：**\n\n* 导入头文件\n```oc\n#import \u003cUnvsSDK/UnvsSDK.h\u003e\n```\n\n* 初始化\n```oc\n// AppId在UCloud号码认证平台申请\n[[UnvsManager shared] registerWithAppId:@\"xxxxx\"];\n// 开启日志\n[[UnvsManager shared] consolePrintLoggerEnable:YES];\n// 设置超时\n[[UnvsManager shared] setTimeoutInterval:6000];\n```\n\n* 预加载授权页（取号）\n```oc\n- (void)preLoadLoginAuthorizePageWithCompletion:(void(^)(NSError * _Nullable))completion;\n```\n\n* 加载授权页\n```oc\n- (void)loadLoginAuthorizePageWithViewConfig:(UAuthViewConfig *)viewConfig completion:(void (^)(NSError *error, NSString *token))completion;\n```\n\n* 关闭授权页\n```oc\n- (void)unloadLoginAuthorizePageAnimated:(BOOL)animated completion:(void (^_Nullable)(void))completion;\n```\n\n-------\n\n**本机号码验证使用步骤：**\n\n* 预加载授权页（取号）\n```oc\n- (void)preLoadLoginAuthorizePageWithCompletion:(void(^)(NSError * _Nullable))completion;\n```\n\n* 手机号码检测（获取验证Token）\n```oc\n- (void)verifyPhoneNumberCompletion:(void(^)(NSError * _Nullable, NSString * _Nullable))completion;\n```\n\n## 三、SDK接口说明\n\n#### 2.0 初始化SDK\n    \n**接口描述** \n\n\u003e  初始化SDK。\n\n**接口示例**\n\n```oc\n[[UnvsManager shared] registerWithAppId:@\"xxxxx\"];\n```\n\n**参数说明**\n\n\u003e appId: UCloud号码认证平台申请应用ID。\n\n-------\n\n#### 2.1 预加载授权页（取号）\n\n**接口描述** \n\n\u003e  预加载授权页，使用前应先判断运营商信息、网络信息等。\n\n**接口示例**\n\n```oc\n- (void)preLoadLoginAuthorizePageWithCompletion:(void(^)(NSError * _Nullable))completion;\n```\n\n**回调说明**\n\n\u003e 错误码:`200027`--\u003e蜂窝网络未开启；`-10003`--\u003e蜂窝网络权限未开启；其它错误码参照运营商错误码列表。\n\n-------\n\n#### 2.2 加载授权页\n\n**接口描述** \n\n\u003e  拉取授权页。\n\n**接口示例**\n\n```oc\n- (void)loadLoginAuthorizePageWithViewConfig:(UAuthViewConfig *)viewConfig completion:(void (^)(NSError *error, NSString *token))completion;\n```\n\n**参数说明**\n\n\u003e viewConfig: 授权页配置model。\n\n**回调说明**\n\n\u003e 错误码: 参照运营商错误码列表。\n\u003e token: 取号token，使用该token去开发者应用后台换取完整手机号码。\n\n-------\n\n#### 2.3 关闭授权页\n\n**接口描述** \n\n\u003e  关闭授权页。\n\n**接口示例**\n\n```oc\n- (void)unloadLoginAuthorizePageAnimated:(BOOL)animated completion:(void (^_Nullable)(void))completion;\n```\n\n**参数说明**\n\n\u003e animated: 是否开启动画。\n\n-------\n\n#### 2.4 本机号码校验Token获取\n\n**接口描述** \n\n\u003e  本机号码校验Token获取。\n\n**接口示例**\n\n```oc\n- (void)verifyPhoneNumberCompletion:(void(^)(NSError * _Nullable, NSString * _Nullable))completion;\n```\n\n**回调说明**\n\n\u003e 错误码: 参照运营商错误码列表。\n\u003e token: 本机号码验证token，使用该token去开发者应用后台验证是否是本机手机号码。\n\n-------\n\n#### 2.5 日志打印\n\n**接口描述** \n\n\u003e  日志打印。\n\n**接口示例**\n\n```oc\n- (void)consolePrintLoggerEnable:(BOOL)enable;\n```\n\n**参数说明**\n\n\u003e enable: 是否开启控制台日志打印。\n\n-------\n\n#### 2.6 超时设置\n\n**接口描述** \n\n\u003e  超时设置。\n\n**接口示例**\n\n```oc\n- (void)setTimeoutInterval:(NSTimeInterval)interval;\n```\n\n**参数说明**\n\n\u003e interval: 单位毫秒，建议设置为8000毫秒。\n\n-------\n\n#### 2.7 运营商类型\n\n**接口描述** \n\n\u003e  运营商类型。\n\n**接口示例**\n\n```oc\n- (UCarrierType)carrierType;\n```\n\n**参数说明**\n\n\u003e UCarrierType: \n\u003e \n`UCarrierTypeUnknown`--\u003e未知；\n\n`UCarrierTypeMobile`--\u003e中国移动; \n\n`UCarrierTypeUnicome`--\u003e中国联通;\n\n`UCarrierTypeTelecom`--\u003e中国电信。\n\n-------\n\n#### 2.8 连接网络类型\n\n**接口描述** \n\n\u003e  当前连接网络类型。\n\n**接口示例**\n\n```oc\n- (UNetworkType)networkType;\n```\n\n**参数说明**\n\n\u003e UNetworkType:\n\u003e \n`UNetworkTypeUnknown`--\u003e未知\n\n`UNetworkTypeNotReachable`--\u003e无网络\n\n`UNetworkTypeCellular`--\u003e数据流量\n\n`UNetworkTypeWifi`--\u003eWiFi\n\n`UNetworkTypeCellularAndWifi`--\u003e数据流量+WiFi\n\n-------\n\n#### 2.9 SDK版本\n\n**接口描述** \n\n\u003e  当前SDK版本。\n\n**接口示例**\n\n```oc\n- (NSString *)sdkVersion;\n```\n\n## 四、其他注意事项\n\n其它接口的使用方法，请参考Demo中的示例。\n        \n\n\t\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fucloud%2Funvs-ios-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fucloud%2Funvs-ios-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fucloud%2Funvs-ios-sdk/lists"}