Compare commits
52 Commits
master
...
phiz_2.42.
Author | SHA1 | Date |
---|---|---|
Stewen | 5f907e9b4f | |
Stewen | 8274fe3aaf | |
Stewen | b09e60067c | |
Stewen | 2aa8cf9b15 | |
Sean | 1b566ef884 | |
Stewen | 8574fc53c0 | |
Stewen | cedb23eec5 | |
Sean | 31f68432f9 | |
Sean | 08a5a23fde | |
Sean | 4999057d25 | |
Stewen | 5b29167042 | |
Stewen | b7b59390c9 | |
Stewen | 275ca3d4a1 | |
Stewen | efcabfe7c8 | |
Stewen | c291d64199 | |
Stewen | ebc5edcbf5 | |
Stewen | 892035a0c8 | |
Stewen | c9c7f00cb4 | |
Stewen | 5606f294e5 | |
Stewen | 52e29a405e | |
Stewen | ac757dbfb5 | |
Stewen | 2da5b8ead3 | |
Stewen | 7a95d27791 | |
Stewen | 685ff6ff1b | |
Stewen | 8e85abcb15 | |
Stewen | b3c70cd5f2 | |
Stewen | a5de8826c8 | |
Stewen | 9c4c772c70 | |
Stewen | fa41022f41 | |
Stewen | 03eedd4991 | |
Stewen | 70f910a76c | |
Stewen | 40e6eeda59 | |
Stewen | 99d074d023 | |
Stewen | c030e31a5a | |
Stewen | 0ac5a988dc | |
stewen | 98168c167e | |
stewen | f2077784db | |
stewen | 2ed4c891c5 | |
stewen | f9ee987c5a | |
stewen | 2b3bd6a226 | |
stewen | 957f14dde5 | |
stewen | 6749f2fc82 | |
stewen | a6bd02e789 | |
stewen | 366f8ab9ac | |
stewen | 58a8e5b804 | |
stewen | 9951bebc56 | |
stewen | 8ef8d78b2a | |
jayce | b800cb3786 | |
jayce | f097d86cd1 | |
jayce | 195b2d11a9 | |
simpleman1984@126.com | 4df164b35f | |
simpleman1984@126.com | 4cfdbafcbf |
|
@ -91,6 +91,6 @@ kapt {
|
|||
}
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation 'com.finogeeks.lib:finapplet:2.41.11'
|
||||
implementation 'com.finogeeks.mop:plugins:2.41.11'
|
||||
implementation 'com.finogeeks.lib:finapplet:2.42.7'
|
||||
implementation 'com.finogeeks.mop:plugins:2.42.7'
|
||||
}
|
|
@ -133,6 +133,7 @@ public class InitSDKModule extends BaseApi {
|
|||
configBuilder.setSchemes(schemes);
|
||||
}
|
||||
configBuilder.setDebugMode((Boolean) configMap.get("debug"));
|
||||
configBuilder.setEnableLog((Boolean) configMap.get("debug"));
|
||||
Integer maxRunningApplet = (Integer) configMap.get("maxRunningApplet");
|
||||
if (maxRunningApplet != null) {
|
||||
configBuilder.setMaxRunningApplet(maxRunningApplet);
|
||||
|
@ -194,12 +195,24 @@ public class InitSDKModule extends BaseApi {
|
|||
if (appletText != null) {
|
||||
configBuilder.setAppletText(appletText);
|
||||
}
|
||||
|
||||
Object localeLanguage = configMap.get("localeLanguage");
|
||||
if (localeLanguage != null) {
|
||||
String language = (String) localeLanguage;
|
||||
if (language.contains("_")) {
|
||||
String[] locales = language.split("_");
|
||||
configBuilder.setLocale(new Locale(locales[0], locales[1]));
|
||||
} else {
|
||||
configBuilder.setLocale(new Locale(language));
|
||||
}
|
||||
} else {
|
||||
Integer languageInteger = (Integer) configMap.get("language");
|
||||
if (languageInteger == 1) {
|
||||
configBuilder.setLocale(Locale.ENGLISH);
|
||||
} else {
|
||||
configBuilder.setLocale(Locale.SIMPLIFIED_CHINESE);
|
||||
}
|
||||
}
|
||||
|
||||
// uiConfig
|
||||
FinAppConfig.UIConfig uiConfig = InitUtils.createUIConfigFromMap(uiConfigMap);
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.finogeeks.mop.api.mop;
|
|||
|
||||
import android.content.Context;
|
||||
|
||||
import com.finogeeks.finochat.sdkcore.client.FinoChatSDKCoreClient;
|
||||
import com.finogeeks.finclip.sdkcore.manager.FinClipSDKCoreManager;
|
||||
import com.finogeeks.lib.applet.client.FinAppClient;
|
||||
import com.finogeeks.lib.applet.db.entity.FinApplet;
|
||||
import com.finogeeks.mop.api.BaseApi;
|
||||
|
@ -25,7 +25,7 @@ public class SmSignModule extends BaseApi {
|
|||
@Override
|
||||
public void invoke(String event, Map param, ICallback callback) {
|
||||
String text = (String) param.get("plainText");
|
||||
String result = FinoChatSDKCoreClient.getInstance().finoLicenseService().messageDigest(text);
|
||||
String result = new FinClipSDKCoreManager.Builder().build().messageDigestBySM(text);
|
||||
Map<String, Object> res = new HashMap<>();
|
||||
res.put("data", result);
|
||||
callback.onSuccess(res);
|
||||
|
|
|
@ -0,0 +1,68 @@
|
|||
export LANG=en_US.UTF-8
|
||||
export FASTLANE_DISABLE_COLORS=1
|
||||
|
||||
|
||||
export version="$1"
|
||||
export iosVersion="$2"
|
||||
export androidVersion="$3"
|
||||
|
||||
#version=`git describe --abbrev=0 --tags | tr -d '\\n' | tr -d '\\t'`
|
||||
|
||||
echo "当前版本号:${version}"
|
||||
echo "依赖的iOS:${iosVersion}"
|
||||
echo "依赖的Android:${androidVersion}"
|
||||
|
||||
#git reset --hard
|
||||
#git checkout ${version}
|
||||
|
||||
# 更新 pubspec.yaml
|
||||
cp -r pubspec.tpl.yaml pubspec.yaml
|
||||
sed -i "" "s/__mop_flutter_sdk_version__/${version}/g" pubspec.yaml
|
||||
|
||||
# 更新iOS podspec
|
||||
if [ -n "$iosVersion" ]
|
||||
then
|
||||
echo "更新mop.podspec====>"
|
||||
cp -r ios/mop.podspec.tpl ios/mop.podspec
|
||||
sed -i "" "s/__finapplet_version__/${iosVersion}/g" ios/mop.podspec
|
||||
|
||||
fi
|
||||
|
||||
# 更新android gradle
|
||||
if [ -n "$androidVersion" ]
|
||||
then
|
||||
echo "更新build.gradle====>"
|
||||
cp -r android/build.gradle.tpl android/build.gradle
|
||||
sed -i "" "s/__finapplet_version__/${androidVersion}/g" android/build.gradle
|
||||
|
||||
fi
|
||||
|
||||
cat pubspec.yaml
|
||||
|
||||
git remote add ssh-origin ssh://git@gitlab.finogeeks.club:2233/finclipsdk/finclip-flutter-sdk.git
|
||||
|
||||
git add .
|
||||
git commit -m "release: version:$version"
|
||||
git tag -d ${version}
|
||||
git push ssh-origin --delete tag ${version}
|
||||
git tag -a ${version} -m 'FinClip-Flutter-SDK发版'
|
||||
git push ssh-origin HEAD:refs/heads/master --tags -f
|
||||
|
||||
|
||||
#export http_proxy=http://127.0.0.1:1087
|
||||
#export https_proxy=http://127.0.0.1:1087
|
||||
|
||||
|
||||
flutter packages pub publish --dry-run --server=https://pub.dartlang.org
|
||||
|
||||
flutter packages pub publish --server=https://pub.dartlang.org --force
|
||||
|
||||
#unset http_proxy
|
||||
#unset https_proxy
|
||||
|
||||
|
||||
git remote add github ssh://git@github.com/finogeeks/mop-flutter-sdk.git
|
||||
|
||||
#git push github HEAD:refs/heads/master --tags
|
||||
|
||||
git push github HEAD:refs/heads/master
|
|
@ -83,9 +83,26 @@ class _MyAppState extends State<MyApp> {
|
|||
|
||||
Mop.instance.registerExtensionApi('getUserProfile', getUserProfile);
|
||||
|
||||
Mop.instance.registerExtensionApi('pushNativePage', pushNativePage);
|
||||
|
||||
if (!mounted) return;
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> pushNativePage(dynamic params) async {
|
||||
print(params);
|
||||
Map<String, dynamic> result = {
|
||||
"userInfo":{
|
||||
"nickName" : "haley",
|
||||
"avatarUrl" : "https://www.finclip.com",
|
||||
"gender" : 1,
|
||||
"country" : "China",
|
||||
"province" : "Guangdong",
|
||||
"city" : "shenzhen",
|
||||
}
|
||||
};
|
||||
return Future.value(result);
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> getUserProfile(dynamic params) async {
|
||||
Map<String, dynamic> result = {
|
||||
"userInfo":{
|
||||
|
@ -262,6 +279,12 @@ class MyAppletHandler extends AppletHandler {
|
|||
return Future.value(result);
|
||||
}
|
||||
|
||||
// @override
|
||||
// Future<Map<String, dynamic>> getUserInfo() {
|
||||
// // TODO: implement getUserInfo
|
||||
// throw UnimplementedError();
|
||||
// }
|
||||
|
||||
@override
|
||||
Future<void> onCustomMenuClick(String appId, String path, String menuId, String appInfo) {
|
||||
// TODO: implement onCustomMenuClick
|
||||
|
|
|
@ -47,41 +47,59 @@
|
|||
- (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) {
|
||||
CFRunLoopStop(CFRunLoopGetMain());
|
||||
CFRunLoopStop(runLoop);
|
||||
userInfo = result;
|
||||
}];
|
||||
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 {
|
||||
NSLog(@"appletInfo:didClickMoreBtnAtPath");
|
||||
__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) {
|
||||
CFRunLoopStop(CFRunLoopGetMain());
|
||||
CFRunLoopStop(runLoop);
|
||||
|
||||
if ([result isKindOfClass:[NSNumber class]]) {
|
||||
flag = [result boolValue];
|
||||
}
|
||||
}];
|
||||
CFRunLoopRun();
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
CFRunLoopStop(runLoop);
|
||||
});
|
||||
|
||||
CFRunLoopRun();
|
||||
return flag;
|
||||
}
|
||||
|
||||
- (NSArray<id<FATAppletMenuProtocol>> *)customMenusInApplet:(FATAppletInfo *)appletInfo atPath:(NSString *)path {
|
||||
NSLog(@"customMenusInApplet");
|
||||
NSLog(@"customMenusInApplet:%@,appletInfo=%@",path,appletInfo);
|
||||
__block NSArray *list;
|
||||
CFRunLoopRef runLoop = CFRunLoopGetCurrent();
|
||||
FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel];
|
||||
[channel invokeMethod:@"extensionApi:getCustomMenus" arguments:@{@"appId": appletInfo.appId} result:^(id _Nullable result) {
|
||||
CFRunLoopStop(CFRunLoopGetMain());
|
||||
CFRunLoopStop(runLoop);
|
||||
if ([result isKindOfClass:[NSArray class]]) {
|
||||
list = result;
|
||||
NSLog(@"customMenusInApplet2222:list=%@",list);
|
||||
}
|
||||
}];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * 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) {
|
||||
|
@ -112,7 +130,9 @@
|
|||
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"];
|
||||
|
@ -133,6 +153,7 @@
|
|||
if ([@"Desktop" isEqualToString:contentInfo[@"menuId"]]) {
|
||||
[self addToDesktopItemClick:appletInfo path:contentInfo[@"path"]];
|
||||
}
|
||||
NSLog(@"HJH2,clickCustomItemMenuWithInfo");
|
||||
}
|
||||
|
||||
- (NSDictionary *)dictionaryRepresentation:(FATAppletInfo *)object {
|
||||
|
|
|
@ -23,6 +23,22 @@
|
|||
return _instance;
|
||||
}
|
||||
|
||||
- (BOOL)getUserInfoWithAppletInfo:(FATAppletInfo *)appletInfo bindGetUserInfo:(void (^)(NSDictionary *result))bindGetUserInfo
|
||||
{
|
||||
FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel];
|
||||
NSLog(@"getUserInfoWithAppletInfo:%@", channel);
|
||||
[channel invokeMethod:@"extensionApi:getUserInfo" arguments:nil result:^(id _Nullable result) {
|
||||
NSDictionary *userInfo;
|
||||
if (![result isKindOfClass:[NSDictionary class]]) {
|
||||
userInfo = @{@"errMsg":@"getUserInfo:fail return value format invalid"};
|
||||
} else {
|
||||
userInfo = result;
|
||||
}
|
||||
bindGetUserInfo(userInfo);
|
||||
}];
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)getUserProfileWithAppletInfo:(FATAppletInfo *)appletInfo
|
||||
bindGetUserProfile:(void (^)(NSDictionary *result))bindGetUserProfile
|
||||
{
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
} else {
|
||||
config.language = FATPreferredLanguageSimplifiedChinese;
|
||||
}
|
||||
|
||||
config.customLanguagePath = self.config[@"customLanguagePath"];
|
||||
|
||||
NSError* error = nil;
|
||||
FATUIConfig *uiconfig = [[FATUIConfig alloc]init];
|
||||
|
|
|
@ -15,15 +15,13 @@
|
|||
{
|
||||
NSLog(@"MOP_registerExtensionApi");
|
||||
FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel];
|
||||
[[FATClient sharedClient] registerExtensionApi:self.name handle:^(id param, FATExtensionApiCallback callback) {
|
||||
NSLog(@"invoke ExtensionApi:");
|
||||
NSLog(@"%@",self.name);
|
||||
NSLog(@"%@",param);
|
||||
NSString* api = [@"extensionApi:" stringByAppendingString:self.name];
|
||||
NSString *name = self.name;
|
||||
[[FATClient sharedClient] registerExtensionApi:name handler:^(FATAppletInfo *appletInfo, id param, FATExtensionApiCallback callback) {
|
||||
NSLog(@"channel:%@---invoke ExtensionApi:%@, param:%@", channel, name, param);
|
||||
NSString *api = [@"extensionApi:" stringByAppendingString:name];
|
||||
[channel invokeMethod:api arguments:param result:^(id _Nullable result) {
|
||||
NSLog(@"extensionApi reslut:%@",result);
|
||||
NSLog(@"extensionApi [%@] reslut:%@", name, result);
|
||||
// 先判断是否flutter发生错误
|
||||
// BOOL isFlutterError = [result isKindOfClass:[FlutterError class]] || result == FlutterMethodNotImplemented;
|
||||
BOOL isValid = [result isKindOfClass:[NSDictionary class]];
|
||||
if (!isValid) {
|
||||
NSLog(@"extensionApi reslut is not NSDictionary");
|
||||
|
@ -34,7 +32,7 @@
|
|||
BOOL hasError = [[result allKeys] containsObject:@"errMsg"];
|
||||
if (hasError) {
|
||||
NSString *errMsg = result[@"errMsg"];
|
||||
NSString *errPrefix = [NSString stringWithFormat:@"%@:fail", self.name];
|
||||
NSString *errPrefix = [NSString stringWithFormat:@"%@:fail", name];
|
||||
BOOL isFail = [errMsg hasPrefix:errPrefix];
|
||||
if (isFail) {
|
||||
NSLog(@"extensionApi reslut:fail");
|
||||
|
|
|
@ -64,7 +64,12 @@ static MopPlugin *_instance;
|
|||
binaryMessenger:[registrar messenger]];
|
||||
[registrar addMethodCallDelegate:_instance channel:appletShareChannel];
|
||||
_instance.shareAppletMethodChannel = appletShareChannel;
|
||||
|
||||
//phiz
|
||||
FlutterMethodChannel* phizChannel = [FlutterMethodChannel
|
||||
methodChannelWithName:@"Phiz"
|
||||
binaryMessenger:[registrar messenger]];
|
||||
[registrar addMethodCallDelegate:_instance channel:phizChannel];
|
||||
_instance.phizMethodChannel = phizChannel;
|
||||
}
|
||||
|
||||
+ (instancetype)instance{
|
||||
|
|
|
@ -17,7 +17,7 @@ A finclip miniprogram flutter sdk.
|
|||
s.dependency 'Flutter'
|
||||
s.ios.deployment_target = '9.0'
|
||||
|
||||
s.dependency 'FinApplet' , '2.41.11'
|
||||
s.dependency 'FinAppletExt' , '2.41.11'
|
||||
s.dependency 'FinApplet' , '2.42.7'
|
||||
s.dependency 'FinAppletExt' , '2.42.7'
|
||||
end
|
||||
|
||||
|
|
15
lib/mop.dart
15
lib/mop.dart
|
@ -210,6 +210,19 @@ class Config {
|
|||
/// SDK的语言类型,默认为中文
|
||||
LanguageType language = LanguageType.Chinese;
|
||||
|
||||
/// iOS属性
|
||||
/// 自定义SDK的语言,优先级高于内置的 language 属性。
|
||||
/// 示例:
|
||||
/// 如果是放在 mainBundle 下,则设置相对路径:@"abc.lproj"
|
||||
/// 如果是放在自定于 Bundle 下,则设置相对路径:@"bundleName.bundle/abc.lproj"
|
||||
String? customLanguagePath;
|
||||
|
||||
/// Android属性
|
||||
/// 自定义SDK的语言,优先级高于内置的 language 属性。
|
||||
/// 语言列表可以参考:https://uutool.cn/info-i18n/ 或者Java类 【java.util.Locale】
|
||||
/// 示例:简体中文:zh_CN,繁体中文:zh_TW,英文:en
|
||||
String? localeLanguage;
|
||||
|
||||
/// Android属性
|
||||
/// 是否使用本地加载tbs内核
|
||||
bool useLocalTbsCore = false;
|
||||
|
@ -267,6 +280,8 @@ class Config {
|
|||
"useLocalTbsCore": useLocalTbsCore,
|
||||
"tbsCoreUrl": tbsCoreUrl,
|
||||
"enableJ2V8": enableJ2V8,
|
||||
"customLanguagePath": customLanguagePath,
|
||||
"localeLanguage": localeLanguage,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: mop
|
||||
description: A Finogeeks MiniProgram Flutter SDK.
|
||||
version: '2.41.11'
|
||||
version: '2.42.7'
|
||||
homepage: https://github.com/finogeeks/mop-flutter-sdk
|
||||
|
||||
environment:
|
||||
|
|
Loading…
Reference in New Issue