Skip to content

Commit af0f503

Browse files
committed
fall back to webview if WeChat is not installed
yorkie#268
1 parent 42c1d41 commit af0f503

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ios/RCTWeChat.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ + (BOOL)requiresMainQueueSetup {
113113
SendAuthReq* req = [[SendAuthReq alloc] init];
114114
req.scope = scope;
115115
req.state = state;
116-
BOOL success = [WXApi sendReq:req];
116+
// BOOL success = [WXApi sendReq:req];
117+
UIViewController *rootViewController = [UIApplication sharedApplication].keyWindow.rootViewController;
118+
BOOL success = [WXApi sendAuthReq:req viewController:rootViewController delegate:self];
117119
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
118120
}
119121

0 commit comments

Comments
 (0)