Commit 57951b00ed1ba0de049cb083598537aab0e4b994

Authored by wdn127929
1 parent d3548fb5

权限说明仅在权限请求的时候

@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 archiveVersion = 1; 3 archiveVersion = 1;
4 classes = { 4 classes = {
5 }; 5 };
6 - objectVersion = 50; 6 + objectVersion = 46;
7 objects = { 7 objects = {
8 8
9 /* Begin PBXBuildFile section */ 9 /* Begin PBXBuildFile section */
@@ -532,7 +532,7 @@ @@ -532,7 +532,7 @@
532 CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; 532 CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements;
533 CODE_SIGN_IDENTITY = "Apple Development"; 533 CODE_SIGN_IDENTITY = "Apple Development";
534 CODE_SIGN_STYLE = Automatic; 534 CODE_SIGN_STYLE = Automatic;
535 - CURRENT_PROJECT_VERSION = 5181; 535 + CURRENT_PROJECT_VERSION = 5182;
536 DEVELOPMENT_TEAM = 8J59HM8B82; 536 DEVELOPMENT_TEAM = 8J59HM8B82;
537 ENABLE_BITCODE = NO; 537 ENABLE_BITCODE = NO;
538 FLUTTER_BUILD_MODE = release; 538 FLUTTER_BUILD_MODE = release;
@@ -678,7 +678,7 @@ @@ -678,7 +678,7 @@
678 CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements"; 678 CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements";
679 CODE_SIGN_IDENTITY = "Apple Development"; 679 CODE_SIGN_IDENTITY = "Apple Development";
680 CODE_SIGN_STYLE = Automatic; 680 CODE_SIGN_STYLE = Automatic;
681 - CURRENT_PROJECT_VERSION = 5181; 681 + CURRENT_PROJECT_VERSION = 5182;
682 DEVELOPMENT_TEAM = 8J59HM8B82; 682 DEVELOPMENT_TEAM = 8J59HM8B82;
683 ENABLE_BITCODE = NO; 683 ENABLE_BITCODE = NO;
684 FLUTTER_BUILD_MODE = release; 684 FLUTTER_BUILD_MODE = release;
@@ -714,7 +714,7 @@ @@ -714,7 +714,7 @@
714 CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; 714 CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
715 CODE_SIGN_IDENTITY = "Apple Development"; 715 CODE_SIGN_IDENTITY = "Apple Development";
716 CODE_SIGN_STYLE = Automatic; 716 CODE_SIGN_STYLE = Automatic;
717 - CURRENT_PROJECT_VERSION = 5181; 717 + CURRENT_PROJECT_VERSION = 5182;
718 DEVELOPMENT_TEAM = 8J59HM8B82; 718 DEVELOPMENT_TEAM = 8J59HM8B82;
719 ENABLE_BITCODE = NO; 719 ENABLE_BITCODE = NO;
720 FLUTTER_BUILD_MODE = release; 720 FLUTTER_BUILD_MODE = release;
@@ -270,7 +270,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -270,7 +270,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
270 if (widget.initialIndex == 0 || 270 if (widget.initialIndex == 0 ||
271 widget.initialIndex == 1 && needRefreshTemp == false) return; 271 widget.initialIndex == 1 && needRefreshTemp == false) return;
272 _initNotification(); 272 _initNotification();
273 - Future.delayed(Duration(minutes: 5), () { 273 + Future.delayed(Duration(minutes: 3), () {
274 //30000 274 //30000
275 ContactModel.getInstance().uploadLocalContact(context); 275 ContactModel.getInstance().uploadLocalContact(context);
276 UserModel usermodel = Provider.of<UserModel>(context, listen: false); 276 UserModel usermodel = Provider.of<UserModel>(context, listen: false);
@@ -736,7 +736,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -736,7 +736,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
736 //获取点击通知栏的自定义参数 736 //获取点击通知栏的自定义参数
737 _getIntent(Map param) async { 737 _getIntent(Map param) async {
738 // if (param != null) { 738 // if (param != null) {
739 - _clearBadge(() {}); 739 + _clearBadge(() {});
740 // } 740 // }
741 741
742 Map notifyParam = param; 742 Map notifyParam = param;
@@ -967,12 +967,15 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -967,12 +967,15 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
967 /// 开启DEBUG 967 /// 开启DEBUG
968 tpush.setEnableDebug(false); 968 tpush.setEnableDebug(false);
969 969
970 - String token = await XgFlutterPlugin.xgToken;  
971 - print(token); 970 + try {
  971 + String token = await XgFlutterPlugin.xgToken;
  972 + print(token);
972 973
973 - if (token != null && token.length > 0) {  
974 -  
975 - userTokenInit(token); 974 + if (token != null && token.length > 0) {
  975 + userTokenInit(token);
  976 + }
  977 + } catch (e) {
  978 + print(e);
976 } 979 }
977 980
978 /// 添加回调事件 981 /// 添加回调事件
@@ -981,7 +984,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -981,7 +984,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
981 // String token = await XgFlutterPlugin.xgToken; 984 // String token = await XgFlutterPlugin.xgToken;
982 // print(token); 985 // print(token);
983 // userTokenInit(token); 986 // userTokenInit(token);
984 - 987 +
985 print("flutter onRegisteredDeviceToken: $msg"); 988 print("flutter onRegisteredDeviceToken: $msg");
986 }, 989 },
987 onRegisteredDone: (String msg) async { 990 onRegisteredDone: (String msg) async {
@@ -111,6 +111,8 @@ class ContactModel { @@ -111,6 +111,8 @@ class ContactModel {
111 // _openAddressBook(context); 111 // _openAddressBook(context);
112 if (!await checkContactPermission()) { 112 if (!await checkContactPermission()) {
113 authority = await requestContactPermission(); 113 authority = await requestContactPermission();
  114 + } else {
  115 + authority = true;
114 } 116 }
115 if (authority) { 117 if (authority) {
116 Iterable<Contact> contacts = 118 Iterable<Contact> contacts =
@@ -50,11 +50,11 @@ class CallLogUtils { @@ -50,11 +50,11 @@ class CallLogUtils {
50 } 50 }
51 } else { 51 } else {
52 try { 52 try {
53 - //全局提示权限使用目的  
54 - if (Platform.isAndroid) {  
55 - DialogUtil.showAuthorityDestination(context, 'h_call',  
56 - '通话记录和电话权限使用说明', '直接从通话记录中获得客户电话号码,快速录入预订信息。');  
57 - } 53 + // //全局提示权限使用目的
  54 + // if (Platform.isAndroid) {
  55 + // DialogUtil.showAuthorityDestination(context, 'h_call',
  56 + // '通话记录和电话权限使用说明', '直接从通话记录中获得客户电话号码,快速录入预订信息。');
  57 + // }
58 58
59 Iterable<CallLogEntry> result = await CallLog.query(); 59 Iterable<CallLogEntry> result = await CallLog.query();
60 return result; 60 return result;
@@ -63,7 +63,11 @@ class DialogUtil { @@ -63,7 +63,11 @@ class DialogUtil {
63 static showAuthorityDestination( 63 static showAuthorityDestination(
64 BuildContext context, String name, String title, String subTitle) async { 64 BuildContext context, String name, String title, String subTitle) async {
65 Timer _timer = Timer(const Duration(seconds: 5), () { 65 Timer _timer = Timer(const Duration(seconds: 5), () {
66 - Navigator.of(context).pop(true); 66 +
  67 + // if(!TickerMode.of(context)){
  68 + Navigator.of(context).pop(true);
  69 + // }
  70 +
67 }); 71 });
68 final action = await showDialog( 72 final action = await showDialog(
69 context: context, 73 context: context,