1
This commit is contained in:
@@ -221,25 +221,25 @@ static CGFloat KEYBOARDHEIGHT = 256 + 20;
|
||||
// 当键盘第一次显示时,尝试唤起主 App 以提示登录(由主 App 决定是否真的弹登录)。
|
||||
- (void)viewDidAppear:(BOOL)animated {
|
||||
[super viewDidAppear:animated];
|
||||
if (!_kb_didTriggerLoginDeepLinkOnce) {
|
||||
_kb_didTriggerLoginDeepLinkOnce = YES;
|
||||
// 仅在未登录时尝试拉起主App登录
|
||||
if (!KBAuthManager.shared.isLoggedIn) {
|
||||
[self kb_tryOpenContainerForLoginIfNeeded];
|
||||
}
|
||||
}
|
||||
// if (!_kb_didTriggerLoginDeepLinkOnce) {
|
||||
// _kb_didTriggerLoginDeepLinkOnce = YES;
|
||||
// // 仅在未登录时尝试拉起主App登录
|
||||
// if (!KBAuthManager.shared.isLoggedIn) {
|
||||
// [self kb_tryOpenContainerForLoginIfNeeded];
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
- (void)kb_tryOpenContainerForLoginIfNeeded {
|
||||
// 使用与主 App 一致的自定义 Scheme
|
||||
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@@//login?src=keyboard", KB_APP_SCHEME]];
|
||||
if (!url) return;
|
||||
KBWeakSelf
|
||||
[self.extensionContext openURL:url completionHandler:^(__unused BOOL success) {
|
||||
// 即使失败也不重复尝试;避免打扰。
|
||||
__unused typeof(weakSelf) selfStrong = weakSelf;
|
||||
}];
|
||||
}
|
||||
//- (void)kb_tryOpenContainerForLoginIfNeeded {
|
||||
// // 使用与主 App 一致的自定义 Scheme
|
||||
// NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@@//login?src=keyboard", KB_APP_SCHEME]];
|
||||
// if (!url) return;
|
||||
// KBWeakSelf
|
||||
// [self.extensionContext openURL:url completionHandler:^(__unused BOOL success) {
|
||||
// // 即使失败也不重复尝试;避免打扰。
|
||||
// __unused typeof(weakSelf) selfStrong = weakSelf;
|
||||
// }];
|
||||
//}
|
||||
|
||||
#pragma mark - Theme
|
||||
|
||||
|
||||
Reference in New Issue
Block a user