AOne iOS SDK接入文档 3.1.5.解析回调成功后的idtoken // 处理通知的方法 (void)handleNotification:(NSNotification )info { NSDictionary dic info.userInfo; NSDictionary query dic[@"query"]; if (!query[@"idtoken"] !((NSString )query[@"idtoken"]).length) { self.skipBtn.text @"获取token失败"; return; } self.idtoken query[@"idtoken"]; self.skipBtn.text @"获取token成功"; NSLog(@"webAuth response:%@",self.skipBtn.text); } 特别注意。需要按照零信任认证之后的返回配置URL Schemes,否则无法返回到集成零信任SDK的app内。 3.2.注册监听 (BOOL)RegistGlobalNotification:(id)observer selector:(SEL)aSelector; 全局监听零信任通知到业务层的回调事件,目前主要是隧道状态。 调用示例 [LXRVPNSDKClient RegistGlobalNotification:self selector:@selector(sdkGlobalMessageNotification:)]; (void)sdkGlobalMessageNotification:(NSNotification)noti { NSLog(@"sdkTopicMessageNotification noti %@", noti); if(noti) { NSDictionary topicDic [noti object] ; if(topicDic) { NSLog(@"SdkInit response:%@",topicDic); } } } 3.3.SDK初始化 (void)SdkInit:(NSDictionary)params completion:(TrustCompletion Nullable)completion; 将外部传入的token传递给SDK,完成零信任SDK的初始化。 调用示例 [LXRVPNSDKClient SdkInit:@{ @"token":@"ffnefnoeof"} completion:^(NSDictionary Nullable response) { NSLog(@"SdkInit response:%@",response); }]; 3.4.启动隧道 (void)SdkStartVPN:(NSDictionary)params completion:(TrustCompletion Nullable)completion; 启动零信任的隧道。 调用示例 [LXRVPNSDKClient SdkStartVPN:@{} completion:^(NSDictionary Nullable response) { NSLog(@"SdkStartVPN response:%@",self.skipBtn.text); }]; 4.接口介绍