commit
63297da6d1
|
@ -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'
|
||||
}
|
|
@ -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<Object> 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) {
|
||||
|
|
|
@ -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<NSString *,id> * _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;
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue