YouzanMobileSDK-iOS icon indicating copy to clipboard operation
YouzanMobileSDK-iOS copied to clipboard

请问如何将认证信息同步给 SDK?

Open faith939339094 opened this issue 5 years ago • 1 comments

ios SDK 7.1.2版本中, 找不到该方法 pod 'YZAppSDK', '~> 7.1.2' -(void)synchronizeCookieKey:(NSString *)cookieKey cookieValue:(NSString *)cookieValue; demo中也找不到, 报错; 请问如何将认证信息同步给 SDK? image

faith939339094 avatar Jan 22 '21 09:01 faith939339094

参考这个伪代码,7.1.2 版本已经移除了这个方法,直接使用SDK的API去登录。 `... self.webView.noticeDelegate = self ...

// YZWebViewDelegate

  • (void)webView:(YZWebView *)webView didReceiveNotice:(YZNotice *)notice {

    switch (notice.type) { case YZNoticeTypeLogin: // 收到登陆请求 { [YZSDK.shared loginWithOpenUserId:@"123456" avatar:@"" extra:@"" nickName:@"testnickName" gender:0 andCompletion:^(BOOL isSuccess, NSString * _Nullable yzOpenId) { if (!isSuccess) { NSLog(@"登录出现异常,请检查入参"); return; }else{ NSLog(@"登录成功,有赞登录接口返回的 yz_open_id =%@",yzOpenId); dispatch_async(dispatch_get_main_queue(), ^{ [self.webView reload]; // 重新加载页面 }); } }]; break; } } }`

cuncle avatar Nov 09 '21 10:11 cuncle