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