commit
63297da6d1
|
@ -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'
|
||||||
}
|
}
|
|
@ -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 {
|
||||||
|
if (FinAppClient.INSTANCE.isFinAppProcess(context)) {
|
||||||
|
FinAppHomeActivity activity = (FinAppHomeActivity) FinAppProcessClient.INSTANCE.getAppletProcessActivity();
|
||||||
|
if (activity != null) {
|
||||||
|
activity.moveTaskToFront();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
String currentAppletId = FinAppClient.INSTANCE.getAppletApiManager().getCurrentAppletId();
|
String currentAppletId = FinAppClient.INSTANCE.getAppletApiManager().getCurrentAppletId();
|
||||||
if (currentAppletId == null || TextUtils.isEmpty(currentAppletId)) {
|
if (currentAppletId != null) {
|
||||||
|
FinAppClient.INSTANCE.getAppletApiManager().moveTaskToFront(currentAppletId);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (callback != null) {
|
if (callback != null) {
|
||||||
callback.onFail(null);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String activityName = FinAppClient.INSTANCE.getAppletApiManager().getAppletActivityName(currentAppletId);
|
|
||||||
if (activityName == null) {
|
|
||||||
if (callback != null) {
|
|
||||||
callback.onFail(null);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (activityName.contains("@")) {
|
|
||||||
activityName = activityName.substring(0, activityName.indexOf("@"));
|
|
||||||
}
|
|
||||||
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);
|
callback.onSuccess(null);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
if (callback != null) {
|
if (callback != null) {
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue