update
commit
4e2d958f01
|
@ -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.33.3'
|
implementation 'com.finogeeks.lib:finapplet:2.33.5'
|
||||||
implementation 'com.finogeeks.mop:plugins:2.33.3'
|
implementation 'com.finogeeks.mop:plugins:2.33.5'
|
||||||
}
|
}
|
|
@ -71,6 +71,8 @@ public class BaseModule extends BaseApi {
|
||||||
if (encryptServerData == null) encryptServerData = false;
|
if (encryptServerData == null) encryptServerData = false;
|
||||||
Boolean debug = (Boolean) param.get("debug");
|
Boolean debug = (Boolean) param.get("debug");
|
||||||
if (debug == null) debug = false;
|
if (debug == null) debug = false;
|
||||||
|
Boolean bindAppletWithMainProcess = (Boolean) param.get("bindAppletWithMainProcess");
|
||||||
|
if (bindAppletWithMainProcess == null) bindAppletWithMainProcess = false;
|
||||||
|
|
||||||
FinAppConfig config = new FinAppConfig.Builder()
|
FinAppConfig config = new FinAppConfig.Builder()
|
||||||
.setSdkKey(appkey)
|
.setSdkKey(appkey)
|
||||||
|
@ -82,6 +84,7 @@ public class BaseModule extends BaseApi {
|
||||||
.setUserId(userId)
|
.setUserId(userId)
|
||||||
.setDebugMode(debug)
|
.setDebugMode(debug)
|
||||||
.setDisableRequestPermissions(disablePermission)
|
.setDisableRequestPermissions(disablePermission)
|
||||||
|
.setBindAppletWithMainProcess(bindAppletWithMainProcess)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
final Application application = MopPluginService.getInstance().getActivity().getApplication();
|
final Application application = MopPluginService.getInstance().getActivity().getApplication();
|
||||||
|
|
|
@ -6,6 +6,7 @@ import android.os.Looper;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.finogeeks.lib.applet.client.FinAppClient;
|
import com.finogeeks.lib.applet.client.FinAppClient;
|
||||||
|
import com.finogeeks.lib.applet.client.FinAppTrace;
|
||||||
import com.finogeeks.mop.api.BaseApi;
|
import com.finogeeks.mop.api.BaseApi;
|
||||||
import com.finogeeks.mop.interfaces.ICallback;
|
import com.finogeeks.mop.interfaces.ICallback;
|
||||||
import com.finogeeks.mop.service.MopPluginService;
|
import com.finogeeks.mop.service.MopPluginService;
|
||||||
|
@ -22,6 +23,8 @@ import io.flutter.plugin.common.MethodChannel;
|
||||||
|
|
||||||
public class ExtensionApiModule extends BaseApi {
|
public class ExtensionApiModule extends BaseApi {
|
||||||
|
|
||||||
|
private static final String TAG = "ExtensionApiModule";
|
||||||
|
|
||||||
private Handler handler = new Handler(Looper.getMainLooper());
|
private Handler handler = new Handler(Looper.getMainLooper());
|
||||||
|
|
||||||
public ExtensionApiModule(Context context) {
|
public ExtensionApiModule(Context context) {
|
||||||
|
@ -52,18 +55,33 @@ public class ExtensionApiModule extends BaseApi {
|
||||||
@Override
|
@Override
|
||||||
public void success(Object result) {
|
public void success(Object result) {
|
||||||
String json = GsonUtil.gson.toJson(result);
|
String json = GsonUtil.gson.toJson(result);
|
||||||
|
FinAppTrace.d(ExtensionApiModule.TAG, "channel invokeMethod:" + name
|
||||||
|
+ " success, result=" + result + ", json=" + json);
|
||||||
JSONObject ret = null;
|
JSONObject ret = null;
|
||||||
if (json != null && !json.equals("null"))
|
if (json != null && !json.equals("null")) {
|
||||||
try {
|
try {
|
||||||
ret = new JSONObject(json);
|
ret = new JSONObject(json);
|
||||||
|
if (ret.has("errMsg")) {
|
||||||
|
String errMsg = ret.getString("errMsg");
|
||||||
|
if (errMsg.startsWith(name + ":fail")) {
|
||||||
|
iCallback.onFail(ret);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
iCallback.onSuccess(ret);
|
iCallback.onSuccess(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void error(String errorCode, String errorMessage, Object errorDetails) {
|
public void error(String errorCode, String errorMessage, Object errorDetails) {
|
||||||
|
FinAppTrace.e(ExtensionApiModule.TAG, "channel invokeMethod:" + name
|
||||||
|
+ " error, errorCode=" + errorCode
|
||||||
|
+ ", errorMessage=" + errorMessage
|
||||||
|
+ ", errorDetails=" + errorDetails);
|
||||||
iCallback.onFail();
|
iCallback.onFail();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"mop","path":"/Users/beetle/Desktop/finogeeks/gitlab/finosprite/finclip-flutter-sdk/","dependencies":[]}],"android":[{"name":"mop","path":"/Users/beetle/Desktop/finogeeks/gitlab/finosprite/finclip-flutter-sdk/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"mop","dependencies":[]}],"date_created":"2021-08-13 09:53:09.007824","version":"2.2.2"}
|
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"mop","path":"/Users/beetle/Desktop/finogeeks/gitlab/finosprite/finclip-flutter-sdk/","dependencies":[]}],"android":[{"name":"mop","path":"/Users/beetle/Desktop/finogeeks/gitlab/finosprite/finclip-flutter-sdk/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"mop","dependencies":[]}],"date_created":"2021-08-19 15:38:17.756101","version":"2.2.2"}
|
|
@ -87,7 +87,7 @@ packages:
|
||||||
path: ".."
|
path: ".."
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "2.33.5"
|
version: "2.33.3"
|
||||||
path:
|
path:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -22,15 +22,28 @@
|
||||||
NSString* api = [@"extensionApi:" stringByAppendingString:self.name];
|
NSString* api = [@"extensionApi:" stringByAppendingString:self.name];
|
||||||
[channel invokeMethod:api arguments:param result:^(id _Nullable result) {
|
[channel invokeMethod:api arguments:param result:^(id _Nullable result) {
|
||||||
NSLog(@"extensionApi reslut:%@",result);
|
NSLog(@"extensionApi reslut:%@",result);
|
||||||
if([result isKindOfClass:[FlutterError class]] || result == FlutterMethodNotImplemented)
|
// 先判断是否flutter发生错误
|
||||||
{
|
BOOL isFlutterError = [result isKindOfClass:[FlutterError class]] || result == FlutterMethodNotImplemented;
|
||||||
|
if (isFlutterError) {
|
||||||
NSLog(@"extensionApi reslut:fail");
|
NSLog(@"extensionApi reslut:fail");
|
||||||
callback(FATExtensionCodeFailure,nil);
|
callback(FATExtensionCodeFailure,nil);
|
||||||
}else
|
return;
|
||||||
{
|
|
||||||
NSLog(@"extensionApi callback:%@",result);
|
|
||||||
callback(FATExtensionCodeSuccess,result);
|
|
||||||
}
|
}
|
||||||
|
// 再判断回调是否为失败
|
||||||
|
BOOL hasError = [[result allKeys] containsObject:@"errMsg"];
|
||||||
|
if (hasError) {
|
||||||
|
NSString *errMsg = result[@"errMsg"];
|
||||||
|
NSString *errPrefix = [NSString stringWithFormat:@"%@:fail", self.name];
|
||||||
|
BOOL isFail = [errMsg hasPrefix:errPrefix];
|
||||||
|
if (isFail) {
|
||||||
|
NSLog(@"extensionApi reslut:fail");
|
||||||
|
callback(FATExtensionCodeFailure,nil);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 其他的按成功处理
|
||||||
|
NSLog(@"extensionApi callback:%@",result);
|
||||||
|
callback(FATExtensionCodeSuccess,result);
|
||||||
}];
|
}];
|
||||||
}];
|
}];
|
||||||
success(@{});
|
success(@{});
|
||||||
|
|
|
@ -17,7 +17,8 @@ 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.33.3'
|
s.dependency 'FinApplet' , '2.33.8-alpha20210826v03'
|
||||||
s.dependency 'FinAppletExt' , '2.33.3'
|
s.dependency 'FinAppletExt' , '2.33.8-alpha20210826v03'
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,8 @@ class Mop {
|
||||||
bool disablePermission,
|
bool disablePermission,
|
||||||
String userId,
|
String userId,
|
||||||
bool encryptServerData = false,
|
bool encryptServerData = false,
|
||||||
bool debug = false}) async {
|
bool debug = false,
|
||||||
|
bool bindAppletWithMainProcess = false}) async {
|
||||||
final Map ret = await _channel.invokeMethod('initialize', {
|
final Map ret = await _channel.invokeMethod('initialize', {
|
||||||
'appkey': appkey,
|
'appkey': appkey,
|
||||||
'secret': secret,
|
'secret': secret,
|
||||||
|
@ -86,7 +87,8 @@ class Mop {
|
||||||
'disablePermission': disablePermission,
|
'disablePermission': disablePermission,
|
||||||
'userId': userId,
|
'userId': userId,
|
||||||
"encryptServerData": encryptServerData,
|
"encryptServerData": encryptServerData,
|
||||||
"debug": debug
|
"debug": debug,
|
||||||
|
"bindAppletWithMainProcess": bindAppletWithMainProcess
|
||||||
});
|
});
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name: mop
|
name: mop
|
||||||
description: A Finogeeks MiniProgram Flutter SDK.
|
description: A Finogeeks MiniProgram Flutter SDK.
|
||||||
version: '2.33.3'
|
version: '2.33.5'
|
||||||
homepage: https://github.com/finogeeks/mop-flutter-sdk
|
homepage: https://github.com/finogeeks/mop-flutter-sdk
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
|
Loading…
Reference in New Issue