提交 37c75264 authored 作者: JarvanMo's avatar JarvanMo

Merge branch 'dev' of github.com:OpenFlutter/fluwx into dev

# Conflicts: # CHANGELOG.md # pubspec.yaml
## 2.4.0
* 支持compressThumbnail
* 升级OkHttp
## 2.3.1 ## 2.3.1
* 修复Android 11无法分享图片的问题 * 修复Android 11无法分享图片的问题
......
...@@ -47,6 +47,6 @@ dependencies { ...@@ -47,6 +47,6 @@ dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.8' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.8'
implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'top.zibin:Luban:1.1.8' implementation 'top.zibin:Luban:1.1.8'
implementation 'com.squareup.okhttp3:okhttp:4.8.0' implementation 'com.squareup.okhttp3:okhttp:4.9.0'
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
} }
...@@ -134,7 +134,7 @@ internal interface FluwxShareHandler : CoroutineScope { ...@@ -134,7 +134,7 @@ internal interface FluwxShareHandler : CoroutineScope {
sourceByteArray.isEmpty() -> { sourceByteArray.isEmpty() -> {
WXImageObject() WXImageObject()
} }
sourceByteArray.size > 500 * 1024 -> { else -> {
WXImageObject().apply { WXImageObject().apply {
if (supportFileProvider && targetHigherThanN) { if (supportFileProvider && targetHigherThanN) {
setImagePath(getFileContentUri(sourceByteArray.toCacheFile(context, sourceImage.suffix))) setImagePath(getFileContentUri(sourceByteArray.toCacheFile(context, sourceImage.suffix)))
...@@ -147,9 +147,6 @@ internal interface FluwxShareHandler : CoroutineScope { ...@@ -147,9 +147,6 @@ internal interface FluwxShareHandler : CoroutineScope {
} }
} }
} }
else -> {
WXImageObject(sourceByteArray)
}
} }
val msg = WXMediaMessage() val msg = WXMediaMessage()
msg.mediaObject = imageObject msg.mediaObject = imageObject
......
...@@ -8,6 +8,7 @@ if (localPropertiesFile.exists()) { ...@@ -8,6 +8,7 @@ if (localPropertiesFile.exists()) {
def flutterRoot = localProperties.getProperty('flutter.sdk') def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) { if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
} }
......
...@@ -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)handleAuthByPhoneLogin:(FlutterMethodCall*)call result:(FlutterResult)result{
UIViewController *vc = UIApplication.sharedApplication.keyWindow.rootViewController;
SendAuthReq *authReq = [[SendAuthReq alloc]init];
authReq.scope = call.arguments[@"scope"];
authReq.state = (call.arguments[@"state"] == (id) [NSNull null]) ? nil : call.arguments[@"state"];
[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 handleAuthByPhoneLogin: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,10 @@ Future _methodHandler(MethodCall methodCall) { ...@@ -240,3 +240,10 @@ Future _methodHandler(MethodCall methodCall) {
_weChatResponseEventHandlerController.add(response); _weChatResponseEventHandlerController.add(response);
return Future.value(); return Future.value();
} }
///IOS only
Future<bool> authWeChatByPhoneLogin(
{@required String scope, String state}) async {
return await _channel
.invokeMethod("authByPhoneLogin", {"scope": scope, "state": state});
}
name: fluwx name: fluwx
description: The capability of implementing WeChat SDKs in Flutter. With Fluwx, developers can use WeChatSDK easily, such as sharing, payment, lanuch mini program and etc. description: The capability of implementing WeChat SDKs in Flutter. With Fluwx, developers can use WeChatSDK easily, such as sharing, payment, lanuch mini program and etc.
version: 2.3.1 version: 2.4.0
homepage: https://github.com/JarvanMo/fluwx homepage: https://github.com/JarvanMo/fluwx
environment: environment:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论