提交 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
* 修复Android 11无法分享图片的问题
......
......@@ -47,6 +47,6 @@ dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.8'
implementation 'androidx.appcompat:appcompat:1.2.0'
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'
}
......@@ -134,7 +134,7 @@ internal interface FluwxShareHandler : CoroutineScope {
sourceByteArray.isEmpty() -> {
WXImageObject()
}
sourceByteArray.size > 500 * 1024 -> {
else -> {
WXImageObject().apply {
if (supportFileProvider && targetHigherThanN) {
setImagePath(getFileContentUri(sourceByteArray.toCacheFile(context, sourceImage.suffix)))
......@@ -147,9 +147,6 @@ internal interface FluwxShareHandler : CoroutineScope {
}
}
}
else -> {
WXImageObject(sourceByteArray)
}
}
val msg = WXMediaMessage()
msg.mediaObject = imageObject
......
......@@ -8,6 +8,7 @@ if (localPropertiesFile.exists()) {
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
......
......@@ -18,4 +18,6 @@
- (void)authByQRCode:(FlutterMethodCall *)call result:(FlutterResult)result;
- (void)stopAuthByQRCode:(FlutterMethodCall *)call result:(FlutterResult)result;
- (void)handAuthByPhoneLogin:(FlutterMethodCall*)call result:(FlutterResult)result;
@end
......@@ -21,6 +21,16 @@ FlutterMethodChannel *_fluwxMethodChannel = nil;
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 {
NSString *openId = call.arguments[@"openId"];
......
......@@ -54,6 +54,8 @@ BOOL handleOpenURLByFluwx = YES;
[self handleSubscribeWithCall:call result:result];
} else if ([@"autoDeduct" isEqualToString:call.method]) {
[self handleAutoDeductWithCall:call result:result];
}else if([@"authByPhoneLogin" isEqualToString:call.method]){
[_fluwxAuthHandler handleAuthByPhoneLogin:call result:result];
} else if ([call.method hasPrefix:@"share"]) {
[_fluwxShareHandler handleShare:call result:result];
} else {
......@@ -178,6 +180,7 @@ BOOL handleOpenURLByFluwx = YES;
}];
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
return [WXApi handleOpenURL:url delegate:[FluwxResponseHandler defaultManager]];
}
......
......@@ -240,3 +240,10 @@ Future _methodHandler(MethodCall methodCall) {
_weChatResponseEventHandlerController.add(response);
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
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
environment:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论