diff --git a/android/build.gradle b/android/build.gradle index 1c9182e..4d05b42 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -91,6 +91,6 @@ kapt { } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'com.finogeeks.lib:finapplet:2.42.7' - implementation 'com.finogeeks.mop:plugins:2.42.7' + implementation 'com.finogeeks.lib:finapplet:2.42.13' + implementation 'com.finogeeks.mop:plugins:2.42.13' } \ No newline at end of file diff --git a/android/src/main/java/com/finogeeks/mop/api/mop/AppletModule.java b/android/src/main/java/com/finogeeks/mop/api/mop/AppletModule.java index 8ac50c0..830e62d 100644 --- a/android/src/main/java/com/finogeeks/mop/api/mop/AppletModule.java +++ b/android/src/main/java/com/finogeeks/mop/api/mop/AppletModule.java @@ -5,8 +5,8 @@ import android.text.TextUtils; import android.util.Log; import com.finogeeks.lib.applet.client.FinAppClient; -import com.finogeeks.lib.applet.interfaces.FinCallback; import com.finogeeks.lib.applet.client.FinAppInfo; +import com.finogeeks.lib.applet.interfaces.FinCallback; import com.finogeeks.lib.applet.sdk.api.request.IFinAppletRequest; import com.finogeeks.lib.applet.sdk.model.StartAppletDecryptRequest; import com.finogeeks.mop.api.BaseApi; @@ -64,6 +64,12 @@ public class AppletModule extends BaseApi { Map params = (Map) param.get("params"); String apiServer = (String) param.get("apiServer"); Boolean isSingleProcess = (Boolean) param.get("isSingleProcess"); + IFinAppletRequest.ProcessMode processMode; + if (Boolean.TRUE.equals(isSingleProcess)) { + processMode = IFinAppletRequest.ProcessMode.SINGLE; + } else { + processMode = IFinAppletRequest.ProcessMode.MULTI; + } // mContext是FlutterActivity, // 在Android 6.0、7.0系统的部分设备中热启动小程序时,如果context参数用mContext,会出现无法启动小程序的问题 // 所以这里使用Application Context @@ -76,7 +82,7 @@ public class AppletModule extends BaseApi { IFinAppletRequest.Companion.fromAppId(apiServer, appId) .setStartParams(startParams) .setSequence(sequence) - .setSingleProcess(Boolean.TRUE.equals(isSingleProcess)), + .setProcessMode(processMode), null ); // FinAppClient.INSTANCE.getAppletApiManager().startApplet(context, apiServer, appId, sequence, startParams,null); @@ -85,7 +91,7 @@ public class AppletModule extends BaseApi { IFinAppletRequest.Companion.fromAppId(appId) .setStartParams(startParams) .setSequence(sequence) - .setSingleProcess(Boolean.TRUE.equals(isSingleProcess)), + .setProcessMode(processMode), null ); } @@ -148,8 +154,14 @@ public class AppletModule extends BaseApi { String offlineMiniprogramZipPath = (String) param.get("offlineMiniprogramZipPath"); String offlineFrameworkZipPath = (String) param.get("offlineFrameworkZipPath"); Boolean isSingleProcess = (Boolean) param.get("isSingleProcess"); + IFinAppletRequest.ProcessMode processMode; + if (Boolean.TRUE.equals(isSingleProcess)) { + processMode = IFinAppletRequest.ProcessMode.SINGLE; + } else { + processMode = IFinAppletRequest.ProcessMode.MULTI; + } - Log.d("MopPlugin", "startApplet (appId=" + appId + ", sequence=" + sequence + " apiServer=" + apiServer + ")"); + Log.d("MopPlugin", "startApplet (appId=" + appId + ", sequence=" + sequence + ", apiServer=" + apiServer + ", isSingleProcess:" + isSingleProcess); // mContext是FlutterActivity, // 在Android 6.0、7.0系统的部分设备中热启动小程序时,如果context参数用mContext,会出现无法启动小程序的问题 // 所以这里使用Application Context @@ -163,7 +175,7 @@ public class AppletModule extends BaseApi { .setSequence(sequence) .setStartParams(params) .setOfflineParams(offlineFrameworkZipPath, offlineMiniprogramZipPath) - .setSingleProcess(Boolean.TRUE.equals(isSingleProcess)), + .setProcessMode(processMode), null); // 改成通过request来启动小程序 // FinAppClient.INSTANCE.getAppletApiManager().startApplet(context, IFinAppletRequest.Companion.fromAppId("apiServer", "appId") @@ -174,17 +186,29 @@ 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"); + IFinAppletRequest.ProcessMode processMode; + if (Boolean.TRUE.equals(isSingleProcess)) { + processMode = IFinAppletRequest.ProcessMode.SINGLE; + } else { + processMode = IFinAppletRequest.ProcessMode.MULTI; + } FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, IFinAppletRequest.Companion.fromDecrypt(info) - .setSingleProcess(Boolean.TRUE.equals(isSingleProcess)), null); + .setProcessMode(processMode), null); // FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, new StartAppletDecryptRequest(info),null); callback.onSuccess(new HashMap()); } - private void qrcodeOpenApplet(Map param, ICallback callback){ + private void qrcodeOpenApplet(Map param, ICallback callback) { String qrcode = String.valueOf(param.get("qrcode")); Boolean isSingleProcess = (Boolean) param.get("isSingleProcess"); + IFinAppletRequest.ProcessMode processMode; + if (Boolean.TRUE.equals(isSingleProcess)) { + processMode = IFinAppletRequest.ProcessMode.SINGLE; + } else { + processMode = IFinAppletRequest.ProcessMode.MULTI; + } FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, IFinAppletRequest.Companion.fromQrCode(qrcode) - .setSingleProcess(Boolean.TRUE.equals(isSingleProcess)), new FinCallback() { + .setProcessMode(processMode), new FinCallback() { @Override public void onSuccess(String s) { callback.onSuccess(new HashMap()); @@ -235,4 +259,4 @@ public class AppletModule extends BaseApi { }); } } -} +} \ No newline at end of file diff --git a/ios/Classes/Api/MOP_initSDK.m b/ios/Classes/Api/MOP_initSDK.m index f5e6e1d..d5323bd 100644 --- a/ios/Classes/Api/MOP_initSDK.m +++ b/ios/Classes/Api/MOP_initSDK.m @@ -7,7 +7,6 @@ #import "Mop_initSDK.h" #import "MOPTools.h" -#import "FinAppletExt.h" @implementation MOP_initSDK @@ -36,7 +35,6 @@ storeConfig.encryptServerData = [dict[@"encryptServerData"] boolValue]; storeConfig.enablePreloadFramework = [storeConfig.apiServer isEqualToString:@"https://api.finclip.com"]; [storeArrayM addObject:storeConfig]; - //google map key [[FATExtClient sharedClient] registerGoogleMapService:dict[@"googleMapApiKey"] placesKey:dict[@"googleMapApiKey"]]; } @@ -67,6 +65,7 @@ config.h5AjaxHookRequestKey = self.config[@"h5AjaxHookRequestKey"]; config.pageCountLimit = [self.config[@"pageCountLimit"] integerValue]; config.schemes = self.config[@"schemes"]; + config.webViewInspectable = [self.config[@"debug"] boolValue]; NSInteger languageInteger = [self.config[@"language"] integerValue]; if (languageInteger == 1) { config.language = FATPreferredLanguageEnglish; @@ -260,17 +259,21 @@ return; } + int logMaxAliveSec = [self.config[@"logMaxAliveSec"] intValue]; + if (logMaxAliveSec) { + [[FATClient sharedClient].logManager setLogFileAliveDuration:logMaxAliveSec]; + } + + BOOL debug = [self.config[@"debug"] boolValue]; NSInteger logLevelIntValue = [self.config[@"logLevel"] integerValue]; - if (logLevelIntValue >= 5) { - [[FATClient sharedClient].logManager closeLog]; - } else { + if (debug && logLevelIntValue < 5) { FATLogLevel logLevel = logLevelIntValue; NSString *logDir = self.config[@"logDir"]; [[FATClient sharedClient].logManager initLogWithLogDir:logDir logLevel:logLevel consoleLog:YES]; + } else { + [FATClient sharedClient].enableLog = NO; } - [[FATClient sharedClient] setEnableLog:YES]; - success(@{}); } diff --git a/ios/Classes/Api/MOP_initialize.m b/ios/Classes/Api/MOP_initialize.m index e8fe5f8..f8b09f1 100644 --- a/ios/Classes/Api/MOP_initialize.m +++ b/ios/Classes/Api/MOP_initialize.m @@ -7,8 +7,7 @@ #import "MOP_initialize.h" #import -#import "FinAppletExt.h" -#import +#import #import "MOPTools.h" @implementation MOP_initialize @@ -127,9 +126,6 @@ // [[FATExtClient sharedClient] fat_prepareExtensionApis]; [[FATClient sharedClient].logManager initLogWithLogDir:nil logLevel:FATLogLevelVerbose consoleLog:YES]; - - [[FATClient sharedClient] setEnableLog:YES]; - success(@{}); diff --git a/ios/Classes/MopPlugin.h b/ios/Classes/MopPlugin.h index 76c822c..62cb5f0 100644 --- a/ios/Classes/MopPlugin.h +++ b/ios/Classes/MopPlugin.h @@ -10,7 +10,6 @@ @property FlutterMethodChannel *shareMethodChannel; @property FlutterMethodChannel *shareAppletMethodChannel; @property FlutterMethodChannel *appletMethodChannel; -@property FlutterMethodChannel *phizMethodChannel; + (instancetype) instance; @end diff --git a/ios/mop.podspec b/ios/mop.podspec index fdce8c1..1abb16a 100644 --- a/ios/mop.podspec +++ b/ios/mop.podspec @@ -2,25 +2,22 @@ # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| -s.name = 'mop' -s.version = '0.1.1' -s.summary = 'finclip miniprogram flutter sdk' -s.description = <<-DESC - A finclip miniprogram flutter sdk. -DESC - s.homepage = 'https://www.finclip.com' -s.license = { :file => '../LICENSE' } -s.author = { 'finogeeks' => 'contact@finogeeks.com' } -s.source = { :path => '.' } -s.source_files = 'Classes/**/*' -s.public_header_files = 'Classes/**/*.h' -s.dependency 'Flutter' -s.ios.deployment_target = '9.0' -s.resources = ['Classes/FinAppletExt/Resource/FinAppletExt.bundle'] -s.vendored_libraries = 'Classes/FinAppletExt/Vendor/fincore/libfincore.a' -s.vendored_libraries = 'Classes/FinAppletExt/Vendor/Lame/libmp3lame.a' -s.static_framework = true + s.name = 'mop' + s.version = '0.1.1' + s.summary = 'finclip miniprogram flutter sdk' + s.description = <<-DESC +A finclip miniprogram flutter sdk. + DESC + s.homepage = 'https://www.finclip.com' + s.license = { :file => '../LICENSE' } + s.author = { 'finogeeks' => 'contact@finogeeks.com' } + s.source = { :path => '.' } + s.source_files = 'Classes/**/*' + s.public_header_files = 'Classes/**/*.h' + s.dependency 'Flutter' + s.ios.deployment_target = '9.0' + + s.dependency 'FinApplet' , '2.42.13' + s.dependency 'FinAppletExt' , '2.42.13' +end -s.dependency 'FinApplet' , '2.42.7' -s.dependency 'FinAppletBLE' -end \ No newline at end of file diff --git a/ios/mop.podspec.tpl b/ios/mop.podspec.tpl index 3b3e209..5071fdc 100644 --- a/ios/mop.podspec.tpl +++ b/ios/mop.podspec.tpl @@ -2,27 +2,22 @@ # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| -s.name = 'mop' -s.version = '0.1.1' -s.summary = 'finclip miniprogram flutter sdk' -s.description = <<-DESC - A finclip miniprogram flutter sdk. -DESC - s.homepage = 'https://www.finclip.com' -s.license = { :file => '../LICENSE' } -s.author = { 'finogeeks' => 'contact@finogeeks.com' } -s.source = { :path => '.' } -s.source_files = 'Classes/**/*' -s.public_header_files = 'Classes/**/*.h' -s.dependency 'Flutter' -s.ios.deployment_target = '9.0' -s.resources = ['Classes/FinAppletExt/Resource/FinAppletExt.bundle'] -s.vendored_libraries = 'Classes/FinAppletExt/Vendor/fincore/libfincore.a' -s.vendored_libraries = 'Classes/FinAppletExt/Vendor/Lame/libmp3lame.a' -s.static_framework = true + s.name = 'mop' + s.version = '0.1.1' + s.summary = 'finclip miniprogram flutter sdk' + s.description = <<-DESC +A finclip miniprogram flutter sdk. + DESC + s.homepage = 'https://www.finclip.com' + s.license = { :file => '../LICENSE' } + s.author = { 'finogeeks' => 'contact@finogeeks.com' } + s.source = { :path => '.' } + s.source_files = 'Classes/**/*' + s.public_header_files = 'Classes/**/*.h' + s.dependency 'Flutter' + s.ios.deployment_target = '9.0' -s.dependency 'FinApplet' , '__finapplet_version__' -# s.dependency 'FinAppletExt' , '__finapplet_version__' -s.dependency 'FinAppletBLE' + s.dependency 'FinApplet' , '__finapplet_version__' + s.dependency 'FinAppletExt' , '__finapplet_version__' +end -end \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index 783ca20..6371b6b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: mop description: A Finogeeks MiniProgram Flutter SDK. -version: '2.42.7' +version: '2.42.13' homepage: https://github.com/finogeeks/mop-flutter-sdk environment: