提交 53530a4a authored 作者: JarvanMo's avatar JarvanMo

Fix #537

上级 c7d35d76
...@@ -135,6 +135,7 @@ class FluwxPlugin : FlutterPlugin, MethodCallHandler, ActivityAware, ...@@ -135,6 +135,7 @@ class FluwxPlugin : FlutterPlugin, MethodCallHandler, ActivityAware,
call.method == "openUrl" -> openUrl(call, result) call.method == "openUrl" -> openUrl(call, result)
call.method == "openRankList" -> openRankList(result) call.method == "openRankList" -> openRankList(result)
call.method == "attemptToResumeMsgFromWx" -> attemptToResumeMsgFromWx(result) call.method == "attemptToResumeMsgFromWx" -> attemptToResumeMsgFromWx(result)
call.method == "selfCheck" -> result.success(null)
else -> result.notImplemented() else -> result.notImplemented()
} }
} }
......
...@@ -29,7 +29,7 @@ EXTERNAL SOURCES: ...@@ -29,7 +29,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
fluwx: 3c7b6df42f83d444d4538f3eaeae079f12d30c37 fluwx: b1dc9ae474e933bef9ff8b82d1452989124c4848
integration_test: 13825b8a9334a850581300559b8839134b124670 integration_test: 13825b8a9334a850581300559b8839134b124670
WechatOpenSDK-XCFramework: acdeeda129efbef9532bca8a10c24e1b4b8c7d69 WechatOpenSDK-XCFramework: acdeeda129efbef9532bca8a10c24e1b4b8c7d69
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string></string> <string/>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
...@@ -25,11 +25,22 @@ ...@@ -25,11 +25,22 @@
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleURLTypes</key> <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> <key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string> <string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSApplicationCategoryType</key> <key>LSApplicationCategoryType</key>
<string></string> <string/>
<key>LSApplicationQueriesSchemes</key> <key>LSApplicationQueriesSchemes</key>
<array> <array>
<string>weixin</string> <string>weixin</string>
......
...@@ -135,7 +135,15 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar; ...@@ -135,7 +135,15 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
[self handleOpenUrlCall:call result:result]; [self handleOpenUrlCall:call result:result];
} else if([@"openWeChatInvoice" isEqualToString:call.method]) { } else if([@"openWeChatInvoice" isEqualToString:call.method]) {
[self openWeChatInvoice:call result:result]; [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) { if (!_attemptToResumeMsgFromWxFlag) {
_attemptToResumeMsgFromWxFlag = YES; _attemptToResumeMsgFromWxFlag = YES;
if (_attemptToResumeMsgFromWxRunnable != nil) { if (_attemptToResumeMsgFromWxRunnable != nil) {
...@@ -208,16 +216,6 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar; ...@@ -208,16 +216,6 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
BOOL isWeChatRegistered = [WXApi registerApp:appId universalLink:universalLink]; 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)); result(@(isWeChatRegistered));
} }
......
...@@ -100,6 +100,13 @@ class Fluwx { ...@@ -100,6 +100,13 @@ class Fluwx {
return FluwxPlatform.instance.attemptToResumeMsgFromWx(); 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 /// Subscribe responses from WeChat
subscribeResponse(Function(WeChatResponse response) listener) { subscribeResponse(Function(WeChatResponse response) listener) {
_responseListeners.add(listener); _responseListeners.add(listener);
......
...@@ -203,6 +203,12 @@ class MethodChannelFluwx extends FluwxPlatform { ...@@ -203,6 +203,12 @@ class MethodChannelFluwx extends FluwxPlatform {
return await methodChannel.invokeMethod('stopAuthByQRCode'); return await methodChannel.invokeMethod('stopAuthByQRCode');
} }
///Only works on iOS in debug mode.
@override
Future<void> selfCheck() async{
return await methodChannel.invokeMethod('selfCheck');
}
@override @override
Future<void> attemptToResumeMsgFromWx() async { Future<void> attemptToResumeMsgFromWx() async {
return await methodChannel.invokeMethod("attemptToResumeMsgFromWx"); return await methodChannel.invokeMethod("attemptToResumeMsgFromWx");
......
...@@ -114,7 +114,11 @@ abstract class FluwxPlatform extends PlatformInterface { ...@@ -114,7 +114,11 @@ abstract class FluwxPlatform extends PlatformInterface {
} }
Future<void> attemptToResumeMsgFromWx() { 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 { Future<bool> get isSupportOpenBusinessView async {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论