1. SDK接入指南

CosmosLoginSDK提供两种方式供iOS开发者选择。

  • 通过cocoaspods(推荐)

  • 手动接入

1.1. 通过cocoapods接入

在工程的Podfile添加一下代码:

source  'https://github.com/cosmos33/MMSpecs.git'

use_frameworks!

pod 'CosmosLoginSDK', '1.0.2'   //含有默认授权页的资源文件

pod 'CosmosLoginSDK/Require', '1.0.2' //删除默认默认授权页的资源文件

1.2. 手动接入

  • 下载CosmosLogin Product文件夹下为SDK

  • 工程配置 Build Settings ->Other Linker Flags 添加 -ObjC

  • 添加依赖库:libc++ , libz.1.2.8

  • 进入主工程build settings, 设置project以及targetEnable BitcodeNO

1.3. SDK使用

初始化SDK

导入头文件
#import <CosmosLoginSDK/CosmosOperatorLoginManager.h>

//cosmos平台注册的appid 
[CosmosOperatorLoginManager initSDK:@""];
配置各运营商id
@param appId  运营商的appid
@param appKey 运营商的appKey
@param registerType 运营商类型
@param encrypType 加密类型:预留参数,暂时传nil

[CosmosOperatorLoginManager registerAppId:@"" appKey:@"" type:CosmosOperatorsMobile encrypType:nil];

[CosmosOperatorLoginManager registerAppId:@"" appKey:@"" type:CosmosOperatorsUnicom encrypType:nil];

[CosmosOperatorLoginManager registerAppId:@"" appKey:@"" type:CosmosOperatorsTelecom encrypType:nil];

1.4. Demo下载地址

@Copyright © cosmos 2019 all right reserved,powered by Gitbook修订时间: 2020-04-24 16:31:13

results matching ""

    No results matching ""