sdk 升级
parent
a300a7b5b2
commit
3791672084
|
@ -91,6 +91,6 @@ kapt {
|
|||
}
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation 'com.finogeeks.lib:finapplet:2.42.13'
|
||||
implementation 'com.finogeeks.mop:plugins:2.42.13'
|
||||
implementation 'com.finogeeks.lib:finapplet:2.43.5'
|
||||
implementation 'com.finogeeks.mop:plugins:2.43.5'
|
||||
}
|
|
@ -64,12 +64,19 @@ public class AppletModule extends BaseApi {
|
|||
Map<String, String> params = (Map) param.get("params");
|
||||
String apiServer = (String) param.get("apiServer");
|
||||
Boolean isSingleProcess = (Boolean) param.get("isSingleProcess");
|
||||
Boolean isSingTask = (Boolean) param.get("isSingTask");
|
||||
IFinAppletRequest.ProcessMode processMode;
|
||||
if (Boolean.TRUE.equals(isSingleProcess)) {
|
||||
processMode = IFinAppletRequest.ProcessMode.SINGLE;
|
||||
} else {
|
||||
processMode = IFinAppletRequest.ProcessMode.MULTI;
|
||||
}
|
||||
IFinAppletRequest.TaskMode taskMode;
|
||||
if (Boolean.TRUE.equals(isSingTask)) {
|
||||
taskMode = IFinAppletRequest.TaskMode.SINGLE;
|
||||
} else {
|
||||
taskMode = IFinAppletRequest.TaskMode.MULTI;
|
||||
}
|
||||
// mContext是FlutterActivity,
|
||||
// 在Android 6.0、7.0系统的部分设备中热启动小程序时,如果context参数用mContext,会出现无法启动小程序的问题
|
||||
// 所以这里使用Application Context
|
||||
|
@ -82,7 +89,9 @@ public class AppletModule extends BaseApi {
|
|||
IFinAppletRequest.Companion.fromAppId(apiServer, appId)
|
||||
.setStartParams(startParams)
|
||||
.setSequence(sequence)
|
||||
.setProcessMode(processMode),
|
||||
.setProcessMode(processMode)
|
||||
.setTaskMode(taskMode)
|
||||
,
|
||||
null
|
||||
);
|
||||
// FinAppClient.INSTANCE.getAppletApiManager().startApplet(context, apiServer, appId, sequence, startParams,null);
|
||||
|
@ -154,12 +163,19 @@ public class AppletModule extends BaseApi {
|
|||
String offlineMiniprogramZipPath = (String) param.get("offlineMiniprogramZipPath");
|
||||
String offlineFrameworkZipPath = (String) param.get("offlineFrameworkZipPath");
|
||||
Boolean isSingleProcess = (Boolean) param.get("isSingleProcess");
|
||||
Boolean isSingTask = (Boolean) param.get("isSingTask");
|
||||
IFinAppletRequest.ProcessMode processMode;
|
||||
if (Boolean.TRUE.equals(isSingleProcess)) {
|
||||
processMode = IFinAppletRequest.ProcessMode.SINGLE;
|
||||
} else {
|
||||
processMode = IFinAppletRequest.ProcessMode.MULTI;
|
||||
}
|
||||
IFinAppletRequest.TaskMode taskMode;
|
||||
if (Boolean.TRUE.equals(isSingTask)) {
|
||||
taskMode = IFinAppletRequest.TaskMode.SINGLE;
|
||||
} else {
|
||||
taskMode = IFinAppletRequest.TaskMode.MULTI;
|
||||
}
|
||||
|
||||
Log.d("MopPlugin", "startApplet (appId=" + appId + ", sequence=" + sequence + ", apiServer=" + apiServer + ", isSingleProcess:" + isSingleProcess);
|
||||
// mContext是FlutterActivity,
|
||||
|
@ -175,7 +191,8 @@ public class AppletModule extends BaseApi {
|
|||
.setSequence(sequence)
|
||||
.setStartParams(params)
|
||||
.setOfflineParams(offlineFrameworkZipPath, offlineMiniprogramZipPath)
|
||||
.setProcessMode(processMode),
|
||||
.setProcessMode(processMode)
|
||||
.setTaskMode(taskMode),
|
||||
null);
|
||||
// 改成通过request来启动小程序
|
||||
// FinAppClient.INSTANCE.getAppletApiManager().startApplet(context, IFinAppletRequest.Companion.fromAppId("apiServer", "appId")
|
||||
|
@ -186,14 +203,21 @@ public class AppletModule extends BaseApi {
|
|||
private void scanOpenApplet(Map param, ICallback callback) {
|
||||
String info = String.valueOf(param.get("info"));
|
||||
Boolean isSingleProcess = (Boolean) param.get("isSingleProcess");
|
||||
Boolean isSingTask = (Boolean) param.get("isSingTask");
|
||||
IFinAppletRequest.ProcessMode processMode;
|
||||
if (Boolean.TRUE.equals(isSingleProcess)) {
|
||||
processMode = IFinAppletRequest.ProcessMode.SINGLE;
|
||||
} else {
|
||||
processMode = IFinAppletRequest.ProcessMode.MULTI;
|
||||
}
|
||||
IFinAppletRequest.TaskMode taskMode;
|
||||
if (Boolean.TRUE.equals(isSingTask)) {
|
||||
taskMode = IFinAppletRequest.TaskMode.SINGLE;
|
||||
} else {
|
||||
taskMode = IFinAppletRequest.TaskMode.MULTI;
|
||||
}
|
||||
FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, IFinAppletRequest.Companion.fromDecrypt(info)
|
||||
.setProcessMode(processMode), null);
|
||||
.setProcessMode(processMode).setTaskMode(taskMode), null);
|
||||
// FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, new StartAppletDecryptRequest(info),null);
|
||||
callback.onSuccess(new HashMap());
|
||||
}
|
||||
|
@ -201,14 +225,21 @@ public class AppletModule extends BaseApi {
|
|||
private void qrcodeOpenApplet(Map param, ICallback callback) {
|
||||
String qrcode = String.valueOf(param.get("qrcode"));
|
||||
Boolean isSingleProcess = (Boolean) param.get("isSingleProcess");
|
||||
Boolean isSingTask = (Boolean) param.get("isSingTask");
|
||||
IFinAppletRequest.ProcessMode processMode;
|
||||
if (Boolean.TRUE.equals(isSingleProcess)) {
|
||||
processMode = IFinAppletRequest.ProcessMode.SINGLE;
|
||||
} else {
|
||||
processMode = IFinAppletRequest.ProcessMode.MULTI;
|
||||
}
|
||||
IFinAppletRequest.TaskMode taskMode;
|
||||
if (Boolean.TRUE.equals(isSingTask)) {
|
||||
taskMode = IFinAppletRequest.TaskMode.SINGLE;
|
||||
} else {
|
||||
taskMode = IFinAppletRequest.TaskMode.MULTI;
|
||||
}
|
||||
FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, IFinAppletRequest.Companion.fromQrCode(qrcode)
|
||||
.setProcessMode(processMode), new FinCallback<String>() {
|
||||
.setProcessMode(processMode).setTaskMode(taskMode), new FinCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
callback.onSuccess(new HashMap());
|
||||
|
|
|
@ -25,14 +25,10 @@ public class ExtensionApiModule extends BaseApi {
|
|||
|
||||
private static final String TAG = "ExtensionApiModule";
|
||||
|
||||
private final Context cur;
|
||||
|
||||
private Handler handler = new Handler(Looper.getMainLooper());
|
||||
|
||||
public ExtensionApiModule(Context context) {
|
||||
super(context);
|
||||
cur = context;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -42,13 +38,11 @@ public class ExtensionApiModule extends BaseApi {
|
|||
|
||||
@Override
|
||||
public void invoke(String s, Map param, ICallback iCallback) {
|
||||
boolean isFinAppProcess = FinAppClient.INSTANCE.isFinAppProcess(cur);
|
||||
Log.d(TAG, "ExtensionApiModule invoke register api s:" + s + " param:" + param +" isFinAppProcess:"+isFinAppProcess);
|
||||
if(s.equals("registerExtensionApi")) {
|
||||
MethodChannel channel = MopPluginService.getInstance().getMethodChannel();
|
||||
String name = (String) param.get("name");
|
||||
Log.d(TAG, "registerExtensionApi:" + name);
|
||||
FinAppClient.INSTANCE.getExtensionApiManager().registerApi(new com.finogeeks.lib.applet.api.BaseApi(cur) {
|
||||
FinAppClient.INSTANCE.getExtensionApiManager().registerApi(new com.finogeeks.lib.applet.api.BaseApi(getContext()) {
|
||||
@Override
|
||||
public String[] apis() {
|
||||
return new String[]{name};
|
||||
|
@ -56,7 +50,7 @@ public class ExtensionApiModule extends BaseApi {
|
|||
|
||||
@Override
|
||||
public void invoke(String s, JSONObject jsonObject, com.finogeeks.lib.applet.interfaces.ICallback iCallback) {
|
||||
Log.d("MopPlugin", "invoke extensionApi:" + s + ",params:" + jsonObject+" isFinAppProcess:"+isFinAppProcess);
|
||||
Log.d("MopPlugin", "invoke extensionApi:" + s + ",params:" + jsonObject);
|
||||
Map params = GsonUtil.gson.fromJson(jsonObject.toString(), HashMap.class);
|
||||
handler.post(() -> {
|
||||
channel.invokeMethod("extensionApi:" + name, params, new MethodChannel.Result() {
|
||||
|
@ -162,7 +156,7 @@ public class ExtensionApiModule extends BaseApi {
|
|||
MethodChannel channel = MopPluginService.getInstance().getMethodChannel();
|
||||
String name = (String) param.get("name");
|
||||
Log.d(TAG, "addWebExtentionApi:" + name);
|
||||
FinAppClient.INSTANCE.getExtensionWebApiManager().registerApi(new com.finogeeks.lib.applet.api.BaseApi(cur) {
|
||||
FinAppClient.INSTANCE.getExtensionWebApiManager().registerApi(new com.finogeeks.lib.applet.api.BaseApi(getContext()) {
|
||||
@Override
|
||||
public String[] apis() {
|
||||
return new String[]{name};
|
||||
|
|
|
@ -138,6 +138,12 @@ public class InitSDKModule extends BaseApi {
|
|||
if (maxRunningApplet != null) {
|
||||
configBuilder.setMaxRunningApplet(maxRunningApplet);
|
||||
}
|
||||
|
||||
Integer backgroundFetchPeriod = (Integer) configMap.get("backgroundFetchPeriod");
|
||||
if (backgroundFetchPeriod != null) {
|
||||
configBuilder.setBackgroundFetchPeriod(backgroundFetchPeriod);
|
||||
}
|
||||
|
||||
Integer webViewMixedContentMode = (Integer) configMap.get("webViewMixedContentMode");
|
||||
if (webViewMixedContentMode != null) {
|
||||
configBuilder.setWebViewMixedContentMode(webViewMixedContentMode);
|
||||
|
|
|
@ -39,6 +39,7 @@ public class InitUtils {
|
|||
uiConfig.setHideShareAppletMenu((Boolean) map.get("isHideShareAppletMenu"));
|
||||
uiConfig.setHideAddToDesktopMenu((Boolean) map.get("isHideAddToDesktopMenu"));
|
||||
uiConfig.setHideFavoriteMenu((Boolean) map.get("isHideFavoriteMenu"));
|
||||
uiConfig.setHideClearCacheMenu((Boolean) map.get("isHideClearCacheMenu"));
|
||||
uiConfig.setHideSettingMenu((Boolean) map.get("isHideSettingMenu"));
|
||||
uiConfig.setHideTransitionCloseButton((Boolean) map.get("hideTransitionCloseButton"));
|
||||
uiConfig.setUseNativeLiveComponent((Boolean) map.get("useNativeLiveComponent"));
|
||||
|
|
|
@ -37,46 +37,26 @@
|
|||
if([result isKindOfClass:[FlutterError class]]|| [result isKindOfClass:[FlutterMethodNotImplemented class] ])
|
||||
{
|
||||
completion(FATExtensionCodeFailure,nil);
|
||||
}else
|
||||
{
|
||||
} else {
|
||||
completion(FATExtensionCodeSuccess,result);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (NSDictionary *)getUserInfoWithAppletInfo:(FATAppletInfo *)appletInfo {
|
||||
NSLog(@"getUserInfoWithAppletInfo");
|
||||
__block NSDictionary *userInfo;
|
||||
CFRunLoopRef runLoop = CFRunLoopGetCurrent();
|
||||
|
||||
FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel];
|
||||
[channel invokeMethod:@"extensionApi:getUserInfo" arguments:nil result:^(id _Nullable result) {
|
||||
userInfo = result;
|
||||
CFRunLoopStop(runLoop);
|
||||
}];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
CFRunLoopStop(runLoop);
|
||||
});
|
||||
CFRunLoopRun();
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
- (BOOL)appletInfo:(FATAppletInfo *)appletInfo didClickMoreBtnAtPath:(NSString *)path {
|
||||
__block BOOL flag;
|
||||
CFRunLoopRef runLoop = CFRunLoopGetCurrent();
|
||||
|
||||
FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel];
|
||||
NSLog(@"appletInfo:didClickMoreBtnAtPath,appId=%@,path=%@,channel=%@",appletInfo.appId,path,channel);
|
||||
[channel invokeMethod:@"extensionApi:customCapsuleMoreButtonClick" arguments:@{@"appId": appletInfo.appId} result:^(id _Nullable result) {
|
||||
if ([result isKindOfClass:[NSNumber class]]) {
|
||||
flag = [result boolValue];
|
||||
}
|
||||
CFRunLoopStop(runLoop);
|
||||
}];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
CFRunLoopStop(runLoop);
|
||||
});
|
||||
|
||||
CFRunLoopRun();
|
||||
return flag;
|
||||
}
|
||||
|
@ -89,16 +69,13 @@
|
|||
[channel invokeMethod:@"extensionApi:getCustomMenus" arguments:@{@"appId": appletInfo.appId} result:^(id _Nullable result) {
|
||||
if ([result isKindOfClass:[NSArray class]]) {
|
||||
list = result;
|
||||
NSLog(@"customMenusInApplet2222:list=%@",list);
|
||||
}
|
||||
CFRunLoopStop(runLoop);
|
||||
}];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
CFRunLoopStop(runLoop);
|
||||
});
|
||||
|
||||
CFRunLoopRun();
|
||||
NSLog(@"customMenusInApplet:%@,list=%@",path,list);
|
||||
|
||||
NSMutableArray *models = [NSMutableArray array];
|
||||
for (NSDictionary<NSString *, NSString *> *data in list) {
|
||||
|
@ -129,9 +106,7 @@
|
|||
return models;
|
||||
}
|
||||
|
||||
|
||||
- (void)clickCustomItemMenuWithInfo:(NSDictionary *)contentInfo inApplet:(FATAppletInfo *)appletInfo completion:(void (^)(FATExtensionCode code, NSDictionary *result))completion {
|
||||
NSLog(@"HJH1,clickCustomItemMenuWithInfo");
|
||||
NSError *parseError = nil;
|
||||
NSMutableDictionary *shareDic = [[NSMutableDictionary alloc] initWithDictionary:[self dictionaryRepresentation:appletInfo]];
|
||||
[shareDic setValue:@{@"desc" : shareDic[@"originalInfo"][@"customData"][@"detailDescription"]} forKey:@"params"];
|
||||
|
@ -152,7 +127,6 @@
|
|||
if ([@"Desktop" isEqualToString:contentInfo[@"menuId"]]) {
|
||||
[self addToDesktopItemClick:appletInfo path:contentInfo[@"path"]];
|
||||
}
|
||||
NSLog(@"HJH2,clickCustomItemMenuWithInfo");
|
||||
}
|
||||
|
||||
- (NSDictionary *)dictionaryRepresentation:(FATAppletInfo *)object {
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
|
||||
#import "Mop_initSDK.h"
|
||||
#import "MOPTools.h"
|
||||
#import "FinAppletExt.h"
|
||||
|
||||
|
||||
@implementation MOP_initSDK
|
||||
|
||||
|
@ -70,6 +68,9 @@
|
|||
config.schemes = self.config[@"schemes"];
|
||||
config.webViewInspectable = [self.config[@"debug"] boolValue];
|
||||
NSInteger languageInteger = [self.config[@"language"] integerValue];
|
||||
if (self.config[@"backgroundFetchPeriod"]) {
|
||||
config.backgroundFetchPeriod = [self.config[@"backgroundFetchPeriod"] integerValue];
|
||||
}
|
||||
if (languageInteger == 1) {
|
||||
config.language = FATPreferredLanguageEnglish;
|
||||
} else {
|
||||
|
@ -110,6 +111,7 @@
|
|||
uiconfig.hideRefreshMenu = [_uiConfig[@"isHideRefreshMenu"] boolValue];
|
||||
uiconfig.hideFavoriteMenu = [_uiConfig[@"isHideFavoriteMenu"] boolValue];
|
||||
uiconfig.hideAddToDesktopMenu = [_uiConfig[@"isHideAddToDesktopMenu"] boolValue];
|
||||
uiconfig.hideClearCacheMenu = [_uiConfig[@"isHideClearCacheMenu"] boolValue];
|
||||
|
||||
// 胶囊配置
|
||||
if (_uiConfig[@"capsuleConfig"]) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#import "MOP_initialize.h"
|
||||
#import <FinApplet/FinApplet.h>
|
||||
#import "FinAppletExt.h"
|
||||
#import <FinAppletExt/FinAppletExt.h>
|
||||
#import <FinAppletBLE/FinAppletBLE.h>
|
||||
#import "MOPTools.h"
|
||||
|
||||
|
@ -127,9 +127,6 @@
|
|||
// [[FATExtClient sharedClient] fat_prepareExtensionApis];
|
||||
[[FATClient sharedClient].logManager initLogWithLogDir:nil logLevel:FATLogLevelVerbose consoleLog:YES];
|
||||
|
||||
|
||||
[[FATClient sharedClient] setEnableLog:YES];
|
||||
|
||||
success(@{});
|
||||
|
||||
|
||||
|
|
|
@ -21,9 +21,8 @@ A finclip miniprogram flutter sdk.
|
|||
s.vendored_libraries = 'Classes/FinAppletExt/Vendor/Lame/libmp3lame.a'
|
||||
s.static_framework = true
|
||||
|
||||
s.dependency 'FinApplet' , '2.43.0-dev20230103v05'
|
||||
s.dependency 'FinAppletExt' , '2.43.0-dev20230103v05'
|
||||
s.dependency 'FinApplet' , '2.43.5'
|
||||
s.dependency 'FinAppletExt' , '2.43.5'
|
||||
s.dependency 'FinAppletBLE' , '2.43.0-dev20230103v05'
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -22,8 +22,7 @@ A finclip miniprogram flutter sdk.
|
|||
s.static_framework = true
|
||||
|
||||
s.dependency 'FinApplet' , '__finapplet_version__'
|
||||
# s.dependency 'FinAppletExt' , '__finapplet_version__'
|
||||
s.dependency 'FinAppletBLE'
|
||||
|
||||
s.dependency 'FinAppletExt' , '__finapplet_version__'
|
||||
end
|
||||
|
||||
|
|
60
lib/mop.dart
60
lib/mop.dart
|
@ -46,7 +46,7 @@ class FinStoreConfig {
|
|||
this.cryptType = "MD5",
|
||||
this.fingerprint,
|
||||
this.encryptServerData = false,
|
||||
this.enablePreloadFramework = false,
|
||||
this.enablePreloadFramework = true,
|
||||
this.googleMapApiKey = ''});
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
|
@ -166,7 +166,6 @@ class Config {
|
|||
/// 自定义的scheme数组
|
||||
List<String>? schemes;
|
||||
|
||||
/// Android属性
|
||||
/// 设置debug模式,影响调试和日志。
|
||||
bool debug = false;
|
||||
|
||||
|
@ -201,7 +200,6 @@ class Config {
|
|||
/// 日志记录等级
|
||||
LogLevel logLevel = LogLevel.LEVEL_NONE;
|
||||
|
||||
/// Android属性
|
||||
/// 日志文件最长缓存时间,单位秒。
|
||||
/// 最小不能小于1天,即不能小于 1 * 24 * 60 * 60 秒。
|
||||
int? logMaxAliveSec;
|
||||
|
@ -241,6 +239,9 @@ class Config {
|
|||
/// 是否开启j2v8
|
||||
bool enableJ2V8 = false;
|
||||
|
||||
/// 周期性更新的时间间隔(小时), 设置为0不会发起周期性更新请求,接收设置范围为3-12小时
|
||||
int backgroundFetchPeriod = 12;
|
||||
|
||||
Config(this.finStoreConfigs);
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
|
@ -287,6 +288,7 @@ class Config {
|
|||
"tbsCoreUrl": tbsCoreUrl,
|
||||
"enableJ2V8": enableJ2V8,
|
||||
"customLanguagePath": customLanguagePath,
|
||||
"backgroundFetchPeriod": backgroundFetchPeriod,
|
||||
"localeLanguage": localeLanguage,
|
||||
};
|
||||
}
|
||||
|
@ -342,12 +344,15 @@ class UIConfig {
|
|||
/// 隐藏...弹出菜单中的 【收藏】 菜单
|
||||
bool isHideFavoriteMenu = true;
|
||||
|
||||
// 隐藏...弹出菜单中的 【重新进入小程序】 菜单,默认为false
|
||||
/// 隐藏...弹出菜单中的 【重新进入小程序】 菜单,默认为false
|
||||
bool isHideRefreshMenu = false;
|
||||
|
||||
// 隐藏...弹出菜单中的 【设置】 菜单,默认为false
|
||||
/// 隐藏...弹出菜单中的 【设置】 菜单,默认为false
|
||||
bool isHideSettingMenu = false;
|
||||
|
||||
/// 隐藏...弹出菜单中的 【清理缓存】 菜单,默认为false
|
||||
bool isHideClearCacheMenu = false;
|
||||
|
||||
/// 胶囊按钮配置
|
||||
CapsuleConfig? capsuleConfig;
|
||||
|
||||
|
@ -369,7 +374,7 @@ class UIConfig {
|
|||
// 是否自适应暗黑模式。如果设置为true,则更多页面、关于等原生页面会随着手机切换暗黑,也自动调整为暗黑模式
|
||||
bool autoAdaptDarkMode = false;
|
||||
|
||||
// 是否使用内置的live组件,默认为false。(目前仅iOS支持)
|
||||
// 是否使用内置的live组件,默认为false。
|
||||
// 配置为true时,需要依赖Live扩展SDK。
|
||||
bool useNativeLiveComponent = false;
|
||||
|
||||
|
@ -421,6 +426,7 @@ class UIConfig {
|
|||
"isHideSettingMenu": isHideSettingMenu,
|
||||
"isHideAddToDesktopMenu": isHideAddToDesktopMenu,
|
||||
"isHideFavoriteMenu": isHideFavoriteMenu,
|
||||
"isHideClearCacheMenu": isHideClearCacheMenu,
|
||||
"hideTransitionCloseButton": hideTransitionCloseButton,
|
||||
"capsuleConfig": capsuleConfig?.toMap(),
|
||||
"navHomeConfig": navHomeConfig?.toMap(),
|
||||
|
@ -787,12 +793,16 @@ class BaseAppletRequest {
|
|||
// 是否以单进程模式运行,仅限android,默认为false
|
||||
bool isSingleProcess;
|
||||
|
||||
// 是否以单任务模式运行,仅限android,默认为false
|
||||
bool isSingTask;
|
||||
|
||||
BaseAppletRequest({
|
||||
required this.apiServer,
|
||||
required this.appletId,
|
||||
this.startParams,
|
||||
this.animated = true,
|
||||
this.isSingleProcess = false,
|
||||
this.isSingTask = false,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
|
@ -802,6 +812,7 @@ class BaseAppletRequest {
|
|||
"startParams": startParams,
|
||||
"animated": animated,
|
||||
"isSingleProcess": isSingleProcess,
|
||||
"isSingTask": isSingTask,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -835,6 +846,9 @@ class RemoteAppletRequest {
|
|||
// 是否以单进程模式运行,仅限android,默认为false
|
||||
bool isSingleProcess;
|
||||
|
||||
// 是否以单任务模式运行,仅限android,默认为false
|
||||
bool isSingTask;
|
||||
|
||||
RemoteAppletRequest({
|
||||
required this.apiServer,
|
||||
required this.appletId,
|
||||
|
@ -845,6 +859,7 @@ class RemoteAppletRequest {
|
|||
this.animated = true,
|
||||
this.transitionStyle = TranstionStyle.TranstionStyleUp,
|
||||
this.isSingleProcess = false,
|
||||
this.isSingTask = false,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
|
@ -853,6 +868,7 @@ class RemoteAppletRequest {
|
|||
"appletId": appletId,
|
||||
"animated": animated,
|
||||
"isSingleProcess": isSingleProcess,
|
||||
"isSingTask": isSingTask,
|
||||
"transitionStyle": transitionStyle.index,
|
||||
};
|
||||
if (startParams != null) result["startParams"] = startParams;
|
||||
|
@ -876,13 +892,18 @@ class QRCodeAppletRequest {
|
|||
// 是否以单进程模式运行,仅限android,默认为false
|
||||
bool isSingleProcess;
|
||||
|
||||
QRCodeAppletRequest(this.qrCode, {this.isSingleProcess = false});
|
||||
// 是否以单任务模式运行,仅限android,默认为false
|
||||
bool isSingTask;
|
||||
|
||||
QRCodeAppletRequest(this.qrCode,
|
||||
{this.isSingleProcess = false, this.isSingTask = false});
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"apiServer": qrCode,
|
||||
"animated": animated,
|
||||
"isSingleProcess": isSingleProcess,
|
||||
"isSingTask": isSingTask,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -1020,10 +1041,8 @@ class Mop {
|
|||
/// [customWebViewUserAgent] 设置自定义webview ua
|
||||
/// [appletIntervalUpdateLimit] 设置小程序批量更新周期
|
||||
/// [maxRunningApplet] 设置最大同时运行小程序个数
|
||||
Future<Map> initialize(
|
||||
String sdkkey,
|
||||
String secret, {
|
||||
String? apiServer,
|
||||
Future<Map> initialize(String sdkkey, String secret,
|
||||
{String? apiServer,
|
||||
String? apiPrefix,
|
||||
String? cryptType,
|
||||
bool encryptServerData = false,
|
||||
|
@ -1036,8 +1055,7 @@ class Mop {
|
|||
UIConfig? uiConfig,
|
||||
String? customWebViewUserAgent,
|
||||
int? appletIntervalUpdateLimit,
|
||||
int? maxRunningApplet
|
||||
}) async {
|
||||
int? maxRunningApplet}) async {
|
||||
List<Map<String, dynamic>>? storeConfigs =
|
||||
finStoreConfigs?.map((e) => e.toMap()).toList();
|
||||
|
||||
|
@ -1077,9 +1095,9 @@ class Mop {
|
|||
/// [query] is miniprogram query parameters. example key1=value1&key2=value2
|
||||
/// [sequence] is miniprogram sequence. example 0,1.2.3,4,5...
|
||||
/// [apiServer] is optional. the mop server address. default is https://mp.finogeek.com
|
||||
/// [apiPrefix] is optional. the mop server prefix. default is /api/v1/mop
|
||||
/// [fingerprint] is optional. the mop sdk fingerprint. is nullable
|
||||
/// [cryptType] is optional. cryptType, should be MD5/SM
|
||||
/// [scene]
|
||||
/// [shareDepth]
|
||||
/// [isSingleProcess]
|
||||
Future<Map> openApplet(
|
||||
final String appId, {
|
||||
final String? path,
|
||||
|
@ -1089,6 +1107,7 @@ class Mop {
|
|||
final String? scene,
|
||||
final String? shareDepth,
|
||||
final bool isSingleProcess = false,
|
||||
final bool isSingTask = false,
|
||||
}) async {
|
||||
Map<String, Object> params = {'appId': appId};
|
||||
Map param = {};
|
||||
|
@ -1100,6 +1119,7 @@ class Mop {
|
|||
if (scene != null) param["scene"] = scene;
|
||||
if (shareDepth != null) param["shareDepth"] = shareDepth;
|
||||
params["isSingleProcess"] = isSingleProcess;
|
||||
params["isSingTask"] = isSingTask;
|
||||
final Map ret = await _channel.invokeMethod('openApplet', params);
|
||||
return ret;
|
||||
}
|
||||
|
@ -1112,19 +1132,23 @@ class Mop {
|
|||
|
||||
/// 通过二维码打开小程序
|
||||
/// [qrcode] 二维码内容
|
||||
Future qrcodeOpenApplet(String qrcode, {bool isSingleProcess = false}) async {
|
||||
Future qrcodeOpenApplet(String qrcode,
|
||||
{bool isSingleProcess = false, bool isSingTask = false}) async {
|
||||
Map<String, Object> params = {
|
||||
'qrcode': qrcode,
|
||||
'isSingleProcess': isSingleProcess,
|
||||
'isSingTask': isSingTask,
|
||||
};
|
||||
return await _channel.invokeMapMethod("qrcodeOpenApplet", params);
|
||||
}
|
||||
|
||||
/// (扫码后)解密-鉴权-打开小程序
|
||||
Future scanOpenApplet(String info, {bool isSingleProcess = false}) async {
|
||||
Future scanOpenApplet(String info,
|
||||
{bool isSingleProcess = false, bool isSingTask = false}) async {
|
||||
Map<String, Object> params = {
|
||||
'info': info,
|
||||
'isSingleProcess': isSingleProcess,
|
||||
'isSingTask': isSingTask,
|
||||
};
|
||||
return await _channel.invokeMapMethod("scanOpenApplet", params);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: mop
|
||||
description: A Finogeeks MiniProgram Flutter SDK.
|
||||
version: '2.42.13'
|
||||
version: '2.43.5'
|
||||
homepage: https://github.com/finogeeks/mop-flutter-sdk
|
||||
|
||||
environment:
|
||||
|
|
Loading…
Reference in New Issue