Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 2.1.7
+ 插件兼容ios 2.7.4
## 2.1.6
+ 升级:android 认证 2.7.3,ios 2.7.4
## 2.1.4
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies:

```
dependencies:
jverify: 2.1.6
jverify: 2.1.7
```

### 配置
Expand Down
20 changes: 14 additions & 6 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:async';
import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:jverify/jverify.dart';

Expand Down Expand Up @@ -209,7 +210,7 @@ class _MyAppState extends State<MyApp> {
_showLoading(context);
});
String phoneNum = controllerPHone.text;
if (phoneNum == null || phoneNum.isEmpty) {
if (phoneNum.isEmpty) {
setState(() {
_hideLoading();
_result = "[3002],msg = 没有输入手机号码";
Expand Down Expand Up @@ -313,8 +314,6 @@ class _MyAppState extends State<MyApp> {
uiConfig.numberColor = Colors.blue.value;
uiConfig.numberSize = 18;



uiConfig.sloganOffsetY = isiOS ? 20 : 160;
uiConfig.sloganVerticalLayoutItem = JVIOSLayoutItem.ItemNumber;
uiConfig.sloganTextColor = Colors.black.value;
Expand Down Expand Up @@ -353,9 +352,13 @@ class _MyAppState extends State<MyApp> {
uiConfig.clauseNameTwo = "协议二";
uiConfig.clauseUrlTwo = "http://www.hao123.com";
uiConfig.clauseColor = Colors.red.value;
uiConfig.privacyText = ["1极","4证"];
uiConfig.privacyText = ["1极", "4证"];
uiConfig.privacyTextSize = 13;
uiConfig.privacyItem = [JVPrivacy("自定义协议1","http://www.baidu.com",beforeName: "==",afterName: "++"),JVPrivacy("自定义协议2","http://www.baidu.com")];
uiConfig.privacyItem = [
JVPrivacy("自定义协议1", "http://www.baidu.com",
beforeName: "==", afterName: "++", separator: "*"),
JVPrivacy("自定义协议2", "http://www.baidu.com", separator: "、")
];
//uiConfig.privacyWithBookTitleMark = true;
//uiConfig.privacyTextCenterGravity = false;
uiConfig.authStatusBarStyle = JVIOSBarStyle.StatusBarStyleDarkContent;
Expand All @@ -374,7 +377,6 @@ class _MyAppState extends State<MyApp> {
uiConfig.enterAnim = "activity_slide_enter_bottom";
uiConfig.exitAnim = "activity_slide_exit_bottom";


uiConfig.privacyNavColor = Colors.red.value;
uiConfig.privacyNavTitleTextColor = Colors.blue.value;
uiConfig.privacyNavTitleTextSize = 16;
Expand Down Expand Up @@ -516,6 +518,12 @@ class _MyAppState extends State<MyApp> {
print("receive auth page event :${event.toMap()}");
});
}

@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties.add(StringProperty('f_result_key', f_result_key));
}
}

/// 封装 按钮
Expand Down
22 changes: 19 additions & 3 deletions ios/Classes/JverifyPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -662,10 +662,13 @@ - (void)setCustomUIWithUIConfig:(JVUIConfig *)uiconfig configArguments:(NSDictio
for (NSInteger i = 0; i<privacys.count; i++) {
NSMutableArray *item = [NSMutableArray array];

NSDictionary *obj = [privacys objectAtIndex:i];

//加入协议之间的分隔符
[item addObject:@"、"];
if ([[obj allKeys] containsObject:@"separator"] ) {
[item addObject:[obj objectForKey:@"separator"]];
}
//加入name
NSDictionary *obj = [privacys objectAtIndex:i];
if ([[obj allKeys] containsObject:@"name"] ) {
[item addObject:[obj objectForKey:@"name"]];
}
Expand All @@ -675,7 +678,20 @@ - (void)setCustomUIWithUIConfig:(JVUIConfig *)uiconfig configArguments:(NSDictio
}
//加入协议详细页面的导航栏文字 可以是NSAttributedString类型 自定义 这里是直接拿name进行展示
if ([[obj allKeys] containsObject:@"name"] ) {
[item addObject:[obj objectForKey:@"name"]];
UIColor *privacyNavTitleTextColor = UIColorFromRGB(-1);
if ([self getValue:config key:@"privacyNavTitleTextColor"]) {
privacyNavTitleTextColor = UIColorFromRGB([[self getValue:config key:@"privacyNavTitleTextColor"] intValue]);
}
NSNumber *privacyNavTitleTextSize = [self getValue:config key:@"privacyNavTitleTextSize"];
if (!privacyNavTitleTextSize) {
privacyNavTitleTextSize = @(16);
}
NSDictionary *privayNavTextAttr = @{NSForegroundColorAttributeName:privacyNavTitleTextColor,
NSFontAttributeName:[UIFont systemFontOfSize:[privacyNavTitleTextSize floatValue]]};
NSAttributedString *privayAttr = [[NSAttributedString alloc]initWithString:[obj objectForKey:@"name"] attributes:privayNavTextAttr];
if(privayAttr){
[item addObject:privayAttr];
}
}
//添加一条协议appPrivacyss中
[appPrivacyss addObject:item];
Expand Down
6 changes: 5 additions & 1 deletion lib/jverify.dart
Original file line number Diff line number Diff line change
Expand Up @@ -876,15 +876,18 @@ class JVPrivacy {
String? url;
String? beforeName;
String? afterName;
String? separator;//ios分隔符专属

JVPrivacy(this.name, this.url, {this.beforeName, this.afterName});
JVPrivacy(this.name, this.url,
{this.beforeName, this.afterName, this.separator});

Map toMap() {
return {
'name': name,
'url': url,
'beforeName': beforeName,
'afterName': afterName,
'separator': separator
};
}

Expand All @@ -894,6 +897,7 @@ class JVPrivacy {
map["url"] = this.url;
map["beforeName"] = this.beforeName;
map["afterName"] = this.afterName;
map["separator"] = this.separator;
return map..removeWhere((key, value) => value == null);
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: jverify
description: JIGUANG Official Jverifycation SDK flutter plugin project.
version: 2.1.6
version: 2.1.7
homepage: https://www.jiguang.cn

environment:
Expand Down