Merge branch 'master' into 2.39.0

# Conflicts:
#	android/build.gradle
master
zhongweiguang 2022-12-28 11:22:09 +08:00
commit 63297da6d1
5 changed files with 26 additions and 27 deletions

View File

@ -91,6 +91,6 @@ kapt {
} }
dependencies { dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.finogeeks.lib:finapplet:2.39.0-alpha20221126v06' implementation 'com.finogeeks.lib:finapplet:2.39.1'
implementation 'com.finogeeks.mop:plugins:2.39.0-alpha20221126v06' implementation 'com.finogeeks.mop:plugins:2.39.1'
} }

View File

@ -1,38 +1,29 @@
package com.finogeeks.mop.utils; package com.finogeeks.mop.utils;
import android.app.PendingIntent;
import android.content.Context; 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.FinAppClient;
import com.finogeeks.lib.applet.client.FinAppProcessClient;
import com.finogeeks.lib.applet.main.FinAppHomeActivity;
import com.finogeeks.mop.interfaces.ICallback; import com.finogeeks.mop.interfaces.ICallback;
public class AppletUtils { public class AppletUtils {
public static void moveCurrentAppletToFront(Context context, ICallback<Object> callback) { public static void moveCurrentAppletToFront(Context context, ICallback<Object> callback) {
try { try {
String currentAppletId = FinAppClient.INSTANCE.getAppletApiManager().getCurrentAppletId(); if (FinAppClient.INSTANCE.isFinAppProcess(context)) {
if (currentAppletId == null || TextUtils.isEmpty(currentAppletId)) { FinAppHomeActivity activity = (FinAppHomeActivity) FinAppProcessClient.INSTANCE.getAppletProcessActivity();
if (callback != null) { if (activity != null) {
callback.onFail(null); activity.moveTaskToFront();
} }
return; } else {
} String currentAppletId = FinAppClient.INSTANCE.getAppletApiManager().getCurrentAppletId();
String activityName = FinAppClient.INSTANCE.getAppletApiManager().getAppletActivityName(currentAppletId); if (currentAppletId != null) {
if (activityName == null) { FinAppClient.INSTANCE.getAppletApiManager().moveTaskToFront(currentAppletId);
if (callback != null) {
callback.onFail(null);
} }
return;
} }
if (activityName.contains("@")) { if (callback != null) {
activityName = activityName.substring(0, activityName.indexOf("@")); 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) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
if (callback != null) { if (callback != null) {

View File

@ -76,6 +76,14 @@ static MopPlugin *_instance;
dict[@"path"] = [[FATClient sharedClient] fat_absolutePathWithPath:path]; dict[@"path"] = [[FATClient sharedClient] fat_absolutePathWithPath:path];
result(dict); 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]) { else if ([@"getPhoneNumberResult" isEqualToString:call.method]) {
if ([MOPAppletDelegate instance].bindGetPhoneNumbers) { if ([MOPAppletDelegate instance].bindGetPhoneNumbers) {
NSDictionary *dic = [[NSDictionary alloc] initWithDictionary:call.arguments]; NSDictionary *dic = [[NSDictionary alloc] initWithDictionary:call.arguments];
@ -93,7 +101,7 @@ static MopPlugin *_instance;
MOPBaseApi* api = [MOPApiConverter apiWithRequest: request]; MOPBaseApi* api = [MOPApiConverter apiWithRequest: request];
if (api) { if (api) {
[api setupApiWithSuccess:^(NSDictionary<NSString *,id> * _Nonnull data) { [api setupApiWithSuccess:^(NSDictionary<NSString *,id> * _Nonnull data) {
result(@{@"retMsg":@"ok",@"success":@(YES),@"data": data}); result(@{@"retMsg":@"ok",@"success":@(YES),@"data": data ? : @{}});
} failure:^(id _Nullable error) { } failure:^(id _Nullable error) {
if ([error isKindOfClass:[NSDictionary class]]) { if ([error isKindOfClass:[NSDictionary class]]) {
NSDictionary* dict = (NSDictionary*)error; NSDictionary* dict = (NSDictionary*)error;

View File

@ -17,7 +17,7 @@ A finclip miniprogram flutter sdk.
s.dependency 'Flutter' s.dependency 'Flutter'
s.ios.deployment_target = '9.0' s.ios.deployment_target = '9.0'
s.dependency 'FinApplet' , '2.38.7' s.dependency 'FinApplet' , '2.39.1'
s.dependency 'FinAppletExt' , '2.38.7' s.dependency 'FinAppletExt' , '2.39.1'
end end

View File

@ -1,6 +1,6 @@
name: mop name: mop
description: A Finogeeks MiniProgram Flutter SDK. description: A Finogeeks MiniProgram Flutter SDK.
version: '2.38.9' version: '2.39.1'
homepage: https://github.com/finogeeks/mop-flutter-sdk homepage: https://github.com/finogeeks/mop-flutter-sdk
environment: environment: