Unverified 提交 cbb13fff authored 作者: JarvanMo's avatar JarvanMo 提交者: GitHub

Merge pull request #306 from wtdu/master

phone number sign
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.associated-domains</key>
<array/>
</dict>
</plist>
...@@ -18,4 +18,6 @@ ...@@ -18,4 +18,6 @@
- (void)authByQRCode:(FlutterMethodCall *)call result:(FlutterResult)result; - (void)authByQRCode:(FlutterMethodCall *)call result:(FlutterResult)result;
- (void)stopAuthByQRCode:(FlutterMethodCall *)call result:(FlutterResult)result; - (void)stopAuthByQRCode:(FlutterMethodCall *)call result:(FlutterResult)result;
- (void)handAuthByPhoneLogin:(FlutterMethodCall*)call result:(FlutterResult)result;
@end @end
...@@ -21,6 +21,16 @@ FlutterMethodChannel *_fluwxMethodChannel = nil; ...@@ -21,6 +21,16 @@ FlutterMethodChannel *_fluwxMethodChannel = nil;
return self; return self;
} }
- (void)handAuthByPhoneLogin:(FlutterMethodCall*)call result:(FlutterResult)result{
UIViewController *vc = UIApplication.sharedApplication.keyWindow.rootViewController;
SendAuthReq *authReq = [[SendAuthReq alloc]init];
authReq.scope = @"snsapi_userinfo";
authReq.state = @"123";
[WXApi sendAuthReq:authReq viewController:vc delegate:[FluwxResponseHandler defaultManager] completion:^(BOOL success) {
result(@(success));
}];
}
- (void)handleAuth:(FlutterMethodCall *)call result:(FlutterResult)result { - (void)handleAuth:(FlutterMethodCall *)call result:(FlutterResult)result {
NSString *openId = call.arguments[@"openId"]; NSString *openId = call.arguments[@"openId"];
......
...@@ -54,6 +54,8 @@ BOOL handleOpenURLByFluwx = YES; ...@@ -54,6 +54,8 @@ BOOL handleOpenURLByFluwx = YES;
[self handleSubscribeWithCall:call result:result]; [self handleSubscribeWithCall:call result:result];
} else if ([@"autoDeduct" isEqualToString:call.method]) { } else if ([@"autoDeduct" isEqualToString:call.method]) {
[self handleAutoDeductWithCall:call result:result]; [self handleAutoDeductWithCall:call result:result];
}else if([@"authByPhoneLogin" isEqualToString:call.method]){
[_fluwxAuthHandler handAuthByPhoneLogin:call result:result];
} else if ([call.method hasPrefix:@"share"]) { } else if ([call.method hasPrefix:@"share"]) {
[_fluwxShareHandler handleShare:call result:result]; [_fluwxShareHandler handleShare:call result:result];
} else { } else {
...@@ -178,6 +180,7 @@ BOOL handleOpenURLByFluwx = YES; ...@@ -178,6 +180,7 @@ BOOL handleOpenURLByFluwx = YES;
}]; }];
} }
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
return [WXApi handleOpenURL:url delegate:[FluwxResponseHandler defaultManager]]; return [WXApi handleOpenURL:url delegate:[FluwxResponseHandler defaultManager]];
} }
......
...@@ -240,3 +240,7 @@ Future _methodHandler(MethodCall methodCall) { ...@@ -240,3 +240,7 @@ Future _methodHandler(MethodCall methodCall) {
_weChatResponseEventHandlerController.add(response); _weChatResponseEventHandlerController.add(response);
return Future.value(); return Future.value();
} }
Future<bool> authWechatByPhoneLogin() async{
return await _channel.invokeMethod("authByPhoneLogin");
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论