diff --git a/android/build.gradle b/android/build.gradle index 8e7b9fe..6fbba11 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -91,6 +91,6 @@ kapt { } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'com.finogeeks.lib:finapplet:2.39.0-alpha20221126v06' - implementation 'com.finogeeks.mop:plugins:2.39.0-alpha20221126v06' + implementation 'com.finogeeks.lib:finapplet:2.39.1' + implementation 'com.finogeeks.mop:plugins:2.39.1' } \ No newline at end of file diff --git a/android/src/main/java/com/finogeeks/mop/utils/AppletUtils.java b/android/src/main/java/com/finogeeks/mop/utils/AppletUtils.java index 8c3d6ab..6306111 100644 --- a/android/src/main/java/com/finogeeks/mop/utils/AppletUtils.java +++ b/android/src/main/java/com/finogeeks/mop/utils/AppletUtils.java @@ -1,38 +1,29 @@ package com.finogeeks.mop.utils; -import android.app.PendingIntent; import android.content.Context; -import android.content.Intent; -import android.text.TextUtils; import com.finogeeks.lib.applet.client.FinAppClient; +import com.finogeeks.lib.applet.client.FinAppProcessClient; +import com.finogeeks.lib.applet.main.FinAppHomeActivity; import com.finogeeks.mop.interfaces.ICallback; public class AppletUtils { public static void moveCurrentAppletToFront(Context context, ICallback callback) { try { - String currentAppletId = FinAppClient.INSTANCE.getAppletApiManager().getCurrentAppletId(); - if (currentAppletId == null || TextUtils.isEmpty(currentAppletId)) { - if (callback != null) { - callback.onFail(null); + if (FinAppClient.INSTANCE.isFinAppProcess(context)) { + FinAppHomeActivity activity = (FinAppHomeActivity) FinAppProcessClient.INSTANCE.getAppletProcessActivity(); + if (activity != null) { + activity.moveTaskToFront(); } - return; - } - String activityName = FinAppClient.INSTANCE.getAppletApiManager().getAppletActivityName(currentAppletId); - if (activityName == null) { - if (callback != null) { - callback.onFail(null); + } else { + String currentAppletId = FinAppClient.INSTANCE.getAppletApiManager().getCurrentAppletId(); + if (currentAppletId != null) { + FinAppClient.INSTANCE.getAppletApiManager().moveTaskToFront(currentAppletId); } - return; } - if (activityName.contains("@")) { - activityName = activityName.substring(0, activityName.indexOf("@")); + if (callback != null) { + callback.onSuccess(null); } - Intent intent = new Intent(context, Class.forName(activityName)); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - PendingIntent pendingIntent = PendingIntent.getActivities(context, 0, new Intent[]{intent}, 0); - pendingIntent.send(); - callback.onSuccess(null); } catch (Exception e) { e.printStackTrace(); if (callback != null) { diff --git a/ios/Classes/MopPlugin.m b/ios/Classes/MopPlugin.m index f1821b5..dc760ea 100644 --- a/ios/Classes/MopPlugin.m +++ b/ios/Classes/MopPlugin.m @@ -76,6 +76,14 @@ static MopPlugin *_instance; dict[@"path"] = [[FATClient sharedClient] fat_absolutePathWithPath:path]; result(dict); } + else if ([@"copyFileAsFinFile" isEqualToString:call.method]) { + NSString *appId = call.arguments[@"appId"]; + NSString *path = call.arguments[@"path"]; + NSString *fileName = [path componentsSeparatedByString:@"/"].lastObject; + NSMutableDictionary *dict = [NSMutableDictionary dictionary]; + dict[@"path"] = [[FATClient sharedClient] saveFile:[NSData dataWithContentsOfFile:path] fileName:fileName]; + result(dict); + } else if ([@"getPhoneNumberResult" isEqualToString:call.method]) { if ([MOPAppletDelegate instance].bindGetPhoneNumbers) { NSDictionary *dic = [[NSDictionary alloc] initWithDictionary:call.arguments]; @@ -93,7 +101,7 @@ static MopPlugin *_instance; MOPBaseApi* api = [MOPApiConverter apiWithRequest: request]; if (api) { [api setupApiWithSuccess:^(NSDictionary * _Nonnull data) { - result(@{@"retMsg":@"ok",@"success":@(YES),@"data": data}); + result(@{@"retMsg":@"ok",@"success":@(YES),@"data": data ? : @{}}); } failure:^(id _Nullable error) { if ([error isKindOfClass:[NSDictionary class]]) { NSDictionary* dict = (NSDictionary*)error; diff --git a/ios/mop.podspec b/ios/mop.podspec index 365f8d0..16dc9c9 100644 --- a/ios/mop.podspec +++ b/ios/mop.podspec @@ -17,7 +17,7 @@ A finclip miniprogram flutter sdk. s.dependency 'Flutter' s.ios.deployment_target = '9.0' - s.dependency 'FinApplet' , '2.38.7' - s.dependency 'FinAppletExt' , '2.38.7' + s.dependency 'FinApplet' , '2.39.1' + s.dependency 'FinAppletExt' , '2.39.1' end diff --git a/pubspec.yaml b/pubspec.yaml index 6551acb..097cbb1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: mop description: A Finogeeks MiniProgram Flutter SDK. -version: '2.38.9' +version: '2.39.1' homepage: https://github.com/finogeeks/mop-flutter-sdk environment: