update
commit
4e2d958f01
|
@ -91,6 +91,6 @@ kapt {
|
|||
}
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation 'com.finogeeks.lib:finapplet:2.33.3'
|
||||
implementation 'com.finogeeks.mop:plugins:2.33.3'
|
||||
implementation 'com.finogeeks.lib:finapplet:2.33.5'
|
||||
implementation 'com.finogeeks.mop:plugins:2.33.5'
|
||||
}
|
|
@ -71,6 +71,8 @@ public class BaseModule extends BaseApi {
|
|||
if (encryptServerData == null) encryptServerData = false;
|
||||
Boolean debug = (Boolean) param.get("debug");
|
||||
if (debug == null) debug = false;
|
||||
Boolean bindAppletWithMainProcess = (Boolean) param.get("bindAppletWithMainProcess");
|
||||
if (bindAppletWithMainProcess == null) bindAppletWithMainProcess = false;
|
||||
|
||||
FinAppConfig config = new FinAppConfig.Builder()
|
||||
.setSdkKey(appkey)
|
||||
|
@ -82,6 +84,7 @@ public class BaseModule extends BaseApi {
|
|||
.setUserId(userId)
|
||||
.setDebugMode(debug)
|
||||
.setDisableRequestPermissions(disablePermission)
|
||||
.setBindAppletWithMainProcess(bindAppletWithMainProcess)
|
||||
.build();
|
||||
|
||||
final Application application = MopPluginService.getInstance().getActivity().getApplication();
|
||||
|
|
|
@ -6,6 +6,7 @@ import android.os.Looper;
|
|||
import android.util.Log;
|
||||
|
||||
import com.finogeeks.lib.applet.client.FinAppClient;
|
||||
import com.finogeeks.lib.applet.client.FinAppTrace;
|
||||
import com.finogeeks.mop.api.BaseApi;
|
||||
import com.finogeeks.mop.interfaces.ICallback;
|
||||
import com.finogeeks.mop.service.MopPluginService;
|
||||
|
@ -22,6 +23,8 @@ import io.flutter.plugin.common.MethodChannel;
|
|||
|
||||
public class ExtensionApiModule extends BaseApi {
|
||||
|
||||
private static final String TAG = "ExtensionApiModule";
|
||||
|
||||
private Handler handler = new Handler(Looper.getMainLooper());
|
||||
|
||||
public ExtensionApiModule(Context context) {
|
||||
|
@ -52,18 +55,33 @@ public class ExtensionApiModule extends BaseApi {
|
|||
@Override
|
||||
public void success(Object result) {
|
||||
String json = GsonUtil.gson.toJson(result);
|
||||
FinAppTrace.d(ExtensionApiModule.TAG, "channel invokeMethod:" + name
|
||||
+ " success, result=" + result + ", json=" + json);
|
||||
JSONObject ret = null;
|
||||
if (json != null && !json.equals("null"))
|
||||
if (json != null && !json.equals("null")) {
|
||||
try {
|
||||
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) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
iCallback.onSuccess(ret);
|
||||
}
|
||||
|
||||
@Override
|
||||
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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "2.33.5"
|
||||
version: "2.33.3"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
@ -22,15 +22,28 @@
|
|||
NSString* api = [@"extensionApi:" stringByAppendingString:self.name];
|
||||
[channel invokeMethod:api arguments:param result:^(id _Nullable 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");
|
||||
callback(FATExtensionCodeFailure,nil);
|
||||
}else
|
||||
{
|
||||
NSLog(@"extensionApi callback:%@",result);
|
||||
callback(FATExtensionCodeSuccess,result);
|
||||
return;
|
||||
}
|
||||
// 再判断回调是否为失败
|
||||
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(@{});
|
||||
|
|
|
@ -17,7 +17,8 @@ A finclip miniprogram flutter sdk.
|
|||
s.dependency 'Flutter'
|
||||
s.ios.deployment_target = '9.0'
|
||||
|
||||
s.dependency 'FinApplet' , '2.33.3'
|
||||
s.dependency 'FinAppletExt' , '2.33.3'
|
||||
s.dependency 'FinApplet' , '2.33.8-alpha20210826v03'
|
||||
s.dependency 'FinAppletExt' , '2.33.8-alpha20210826v03'
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -76,7 +76,8 @@ class Mop {
|
|||
bool disablePermission,
|
||||
String userId,
|
||||
bool encryptServerData = false,
|
||||
bool debug = false}) async {
|
||||
bool debug = false,
|
||||
bool bindAppletWithMainProcess = false}) async {
|
||||
final Map ret = await _channel.invokeMethod('initialize', {
|
||||
'appkey': appkey,
|
||||
'secret': secret,
|
||||
|
@ -86,7 +87,8 @@ class Mop {
|
|||
'disablePermission': disablePermission,
|
||||
'userId': userId,
|
||||
"encryptServerData": encryptServerData,
|
||||
"debug": debug
|
||||
"debug": debug,
|
||||
"bindAppletWithMainProcess": bindAppletWithMainProcess
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: mop
|
||||
description: A Finogeeks MiniProgram Flutter SDK.
|
||||
version: '2.33.3'
|
||||
version: '2.33.5'
|
||||
homepage: https://github.com/finogeeks/mop-flutter-sdk
|
||||
|
||||
environment:
|
||||
|
|
Loading…
Reference in New Issue