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

Merge pull request #539 from MrSpiceTea/Runnable

fix runnable
...@@ -143,16 +143,11 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar; ...@@ -143,16 +143,11 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
#endif #endif
result(nil); result(nil);
} else if([@"attemptToResumeMsgFromWx" isEqualToString:call.method]){ } else if([@"attemptToResumeMsgFromWx" isEqualToString:call.method]){
if (!_attemptToResumeMsgFromWxFlag) {
_attemptToResumeMsgFromWxFlag = YES;
if (_attemptToResumeMsgFromWxRunnable != nil) { if (_attemptToResumeMsgFromWxRunnable != nil) {
_attemptToResumeMsgFromWxRunnable(); _attemptToResumeMsgFromWxRunnable();
_attemptToResumeMsgFromWxRunnable = nil; _attemptToResumeMsgFromWxRunnable = nil;
} }
result(nil); result(nil);
} else {
result([FlutterError errorWithCode:@"attemptToResumeMsgFromWx error" message:nil details:nil]);
}
} }
else if ([@"payWithFluwx" isEqualToString:call.method]) { else if ([@"payWithFluwx" isEqualToString:call.method]) {
#ifndef NO_PAY #ifndef NO_PAY
...@@ -1062,7 +1057,7 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar; ...@@ -1062,7 +1057,7 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
[_channel invokeMethod:@"onWXLaunchFromWX" arguments:result]; [_channel invokeMethod:@"onWXLaunchFromWX" arguments:result];
} else { } else {
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
_initialWXReqRunnable = ^() { _attemptToResumeMsgFromWxRunnable = ^() {
__strong typeof(weakSelf) strongSelf = weakSelf; __strong typeof(weakSelf) strongSelf = weakSelf;
[strongSelf->_channel invokeMethod:@"onWXLaunchFromWX" arguments:result]; [strongSelf->_channel invokeMethod:@"onWXLaunchFromWX" arguments:result];
}; };
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论