From b8bf7bf937c11fbba5f189932d4c5b34ec2ddc60 Mon Sep 17 00:00:00 2001 From: v7lin Date: Thu, 26 Dec 2019 23:06:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=87=E6=9C=AC=E5=88=86?= =?UTF-8?q?=E4=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Classes/TencentKitPlugin.m | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/ios/Classes/TencentKitPlugin.m b/ios/Classes/TencentKitPlugin.m index dc145d9..754d634 100644 --- a/ios/Classes/TencentKitPlugin.m +++ b/ios/Classes/TencentKitPlugin.m @@ -37,7 +37,9 @@ enum TencentRetCode { } static NSString *const METHOD_REGISTERAPP = @"registerApp"; -static NSString *const METHOD_ISINSTALLED = @"isInstalled"; +static NSString *const METHOD_ISQQINSTALLED = @"isQQInstalled"; +static NSString *const METHOD_ISTIMINSTALLED = @"isTIMInstalled"; +static NSString *const METHOD_ISQQLITEINSTALLED = @"isQQLiteInstalled"; static NSString *const METHOD_LOGIN = @"login"; static NSString *const METHOD_LOGOUT = @"logout"; static NSString *const METHOD_SHAREMOOD = @"shareMood"; @@ -93,10 +95,12 @@ static NSString *const SCHEME_FILE = @"file"; _oauth = [[TencentOAuth alloc] initWithAppId:appId andDelegate:self]; } result(nil); - } else if ([METHOD_ISINSTALLED isEqualToString:call.method]) { - // 普通大众版 > 办公简洁版 - BOOL isInstalled = [TencentOAuth iphoneQQInstalled] || [TencentOAuth iphoneTIMInstalled]; - result([NSNumber numberWithBool:isInstalled]); + } else if ([METHOD_ISQQINSTALLED isEqualToString:call.method]) { + result([NSNumber numberWithBool:[TencentOAuth iphoneQQInstalled]]); + } else if ([METHOD_ISTIMINSTALLED isEqualToString:call.method]) { + result([NSNumber numberWithBool:[TencentOAuth iphoneTIMInstalled]]); + } else if ([METHOD_ISQQLITEINSTALLED isEqualToString:call.method]) { + result([NSNumber numberWithBool:NO]); } else if ([METHOD_LOGIN isEqualToString:call.method]) { [self login:call result:result]; } else if ([METHOD_LOGOUT isEqualToString:call.method]) { @@ -168,13 +172,11 @@ static NSString *const SCHEME_FILE = @"file"; - (void)shareText:(FlutterMethodCall *)call result:(FlutterResult)result { NSNumber *scene = call.arguments[ARGUMENT_KEY_SCENE]; - NSString *summary = call.arguments[ARGUMENT_KEY_SUMMARY]; - QQApiTextObject *object = [QQApiTextObject objectWithText:summary]; - SendMessageToQQReq *req = [SendMessageToQQReq reqWithContent:object]; if (scene.intValue == SCENE_QQ) { + NSString *summary = call.arguments[ARGUMENT_KEY_SUMMARY]; + QQApiTextObject *object = [QQApiTextObject objectWithText:summary]; + SendMessageToQQReq *req = [SendMessageToQQReq reqWithContent:object]; [QQApiInterface sendReq:req]; - } else if (scene.intValue == SCENE_QZONE) { - [QQApiInterface SendReqToQZone:req]; } result(nil); }