This commit is contained in:
JarvanMo
2023-05-17 18:20:14 +08:00
parent c7d35d76cb
commit 53530a4a6d
7 changed files with 43 additions and 16 deletions

View File

@ -135,6 +135,7 @@ class FluwxPlugin : FlutterPlugin, MethodCallHandler, ActivityAware,
call.method == "openUrl" -> openUrl(call, result)
call.method == "openRankList" -> openRankList(result)
call.method == "attemptToResumeMsgFromWx" -> attemptToResumeMsgFromWx(result)
call.method == "selfCheck" -> result.success(null)
else -> result.notImplemented()
}
}

View File

@ -29,7 +29,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
fluwx: 3c7b6df42f83d444d4538f3eaeae079f12d30c37
fluwx: b1dc9ae474e933bef9ff8b82d1452989124c4848
integration_test: 13825b8a9334a850581300559b8839134b124670
WechatOpenSDK-XCFramework: acdeeda129efbef9532bca8a10c24e1b4b8c7d69

View File

@ -11,7 +11,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleGetInfoString</key>
<string></string>
<string/>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
@ -25,11 +25,22 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array/>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>weixin</string>
<key>CFBundleURLSchemes</key>
<array>
<string>123456</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSApplicationCategoryType</key>
<string></string>
<string/>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>weixin</string>

View File

@ -135,7 +135,15 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
[self handleOpenUrlCall:call result:result];
} else if([@"openWeChatInvoice" isEqualToString:call.method]) {
[self openWeChatInvoice:call result:result];
} else if([@"" isEqualToString:call.method]){
} else if([@"selfCheck" isEqualToString:call.method]) {
#ifndef __OPTIMIZE__
[WXApi checkUniversalLinkReady:^(WXULCheckStep step, WXCheckULStepResult* result) {
NSString *log = [NSString stringWithFormat:@"%@, %u, %@, %@", @(step), result.success, result.errorInfo, result.suggestion];
[self logToFlutterWithDetail:log];
}];
#endif
result(nil);
} else if([@"attemptToResumeMsgFromWx" isEqualToString:call.method]){
if (!_attemptToResumeMsgFromWxFlag) {
_attemptToResumeMsgFromWxFlag = YES;
if (_attemptToResumeMsgFromWxRunnable != nil) {
@ -208,16 +216,6 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
BOOL isWeChatRegistered = [WXApi registerApp:appId universalLink:universalLink];
#if WECHAT_LOGGING
if(isWeChatRegistered) {
[WXApi checkUniversalLinkReady:^(WXULCheckStep step, WXCheckULStepResult* result) {
NSString *log = [NSString stringWithFormat:@"%@, %u, %@, %@", @(step), result.success, result.errorInfo, result.suggestion];
[self logToFlutterWithDetail:log];
}];
}
#endif
result(@(isWeChatRegistered));
}

View File

@ -100,6 +100,13 @@ class Fluwx {
return FluwxPlatform.instance.attemptToResumeMsgFromWx();
}
/// Only works on iOS in debug mode.
/// Check if your app can work with WeChat correctly.
/// Please make sure [registerApi] returns true before self check.
Future<void> selfCheck() async{
return FluwxPlatform.instance.selfCheck();
}
/// Subscribe responses from WeChat
subscribeResponse(Function(WeChatResponse response) listener) {
_responseListeners.add(listener);

View File

@ -203,6 +203,12 @@ class MethodChannelFluwx extends FluwxPlatform {
return await methodChannel.invokeMethod('stopAuthByQRCode');
}
///Only works on iOS in debug mode.
@override
Future<void> selfCheck() async{
return await methodChannel.invokeMethod('selfCheck');
}
@override
Future<void> attemptToResumeMsgFromWx() async {
return await methodChannel.invokeMethod("attemptToResumeMsgFromWx");

View File

@ -114,7 +114,11 @@ abstract class FluwxPlatform extends PlatformInterface {
}
Future<void> attemptToResumeMsgFromWx() {
throw UnimplementedError('authBy() has not been implemented.');
throw UnimplementedError('attemptToResumeMsgFromWx() has not been implemented.');
}
Future<void> selfCheck(){
throw UnimplementedError('selfCheck() has not been implemented.');
}
Future<bool> get isSupportOpenBusinessView async {