Commit 51c47262a1076296dc4ead66ccb0e384bf4f059c

Authored by weixin_45529955
1 parent 285635d6

1.3.3版本注册token提示10006错误,更新版本到最新1.3.4通知增加安卓startxg(id,密码),正常

@@ -994,6 +994,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -994,6 +994,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
994 // } 994 // }
995 // App.sp.setBool("h_notification", true); 995 // App.sp.setBool("h_notification", true);
996 996
  997 + if (!mounted) return;
  998 +
997 /// 开启DEBUG 999 /// 开启DEBUG
998 tpush.setEnableDebug(false); 1000 tpush.setEnableDebug(false);
999 1001
@@ -1369,7 +1371,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -1369,7 +1371,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
1369 /// 启动TPNS服务 1371 /// 启动TPNS服务
1370 LogUtil.v("register:${xgCount.toString()}"); 1372 LogUtil.v("register:${xgCount.toString()}");
1371 // tpush.startXg("1600012876", "INUIMFK21WGH"); 1373 // tpush.startXg("1600012876", "INUIMFK21WGH");
1372 - /// 启动TPNS服务 1374 + /// 启动TPNS服务
1373 /// 注意:为了不影响回调效果,建议在应用启动方法优先添加回调以及调用TPNS注册方法 1375 /// 注意:为了不影响回调效果,建议在应用启动方法优先添加回调以及调用TPNS注册方法
1374 if (Platform.isIOS) { 1376 if (Platform.isIOS) {
1375 tpush.startXg("1600012876", "INUIMFK21WGH"); 1377 tpush.startXg("1600012876", "INUIMFK21WGH");
1 -  
2 import 'dart:async'; 1 import 'dart:async';
3 import 'dart:convert'; 2 import 'dart:convert';
4 import 'dart:io'; 3 import 'dart:io';
@@ -140,7 +139,8 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { @@ -140,7 +139,8 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver {
140 // 'https://qn.colorcun.com/template/heilanguodu-6.png'); 139 // 'https://qn.colorcun.com/template/heilanguodu-6.png');
141 FlutterBugly.init(androidAppId: "f71a313f42", iOSAppId: "3089e4587e"); 140 FlutterBugly.init(androidAppId: "f71a313f42", iOSAppId: "3089e4587e");
142 needRefreshTemp = widget.needReresh; 141 needRefreshTemp = widget.needReresh;
143 - _channel.setMethodCallHandler(platformCallHandler as Future Function(MethodCall call)?); //设置监听 142 + _channel.setMethodCallHandler(
  143 + platformCallHandler as Future Function(MethodCall call)?); //设置监听
144 144
145 AzhonAppUpdate.listener((map) { 145 AzhonAppUpdate.listener((map) {
146 // needUpdate = false; 146 // needUpdate = false;
@@ -335,9 +335,8 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { @@ -335,9 +335,8 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver {
335 } 335 }
336 336
337 if (showData != null && showData.length > 0) { 337 if (showData != null && showData.length > 0) {
338 -  
339 - DateTime edate =  
340 - DateTime.fromMillisecondsSinceEpoch(int.parse(showData[0].edate!) * 1000); 338 + DateTime edate = DateTime.fromMillisecondsSinceEpoch(
  339 + int.parse(showData[0].edate!) * 1000);
341 DialogUtil.cupertinoAlertSellerEdateDialogSim( 340 DialogUtil.cupertinoAlertSellerEdateDialogSim(
342 context, 341 context,
343 title: '温馨提示', 342 title: '温馨提示',
@@ -360,7 +359,7 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { @@ -360,7 +359,7 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver {
360 // //店铺过期日期 359 // //店铺过期日期
361 // _edateShow(); 360 // _edateShow();
362 // }); 361 // });
363 - if (widget.initialIndex == 0 || 362 + if (widget.initialIndex == 0 ||
364 widget.initialIndex == 1 && needRefreshTemp == false) return; 363 widget.initialIndex == 1 && needRefreshTemp == false) return;
365 _initNotification(); 364 _initNotification();
366 return true; 365 return true;
@@ -383,7 +382,7 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { @@ -383,7 +382,7 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver {
383 NavigatorUtil.goHomePageSim(context, initialIndex: _currIndex); 382 NavigatorUtil.goHomePageSim(context, initialIndex: _currIndex);
384 } 383 }
385 } 384 }
386 - if (widget.initialIndex == 0 || 385 + if (widget.initialIndex == 0 ||
387 widget.initialIndex == 1 && needRefreshTemp == false) return; 386 widget.initialIndex == 1 && needRefreshTemp == false) return;
388 _initNotification(); 387 _initNotification();
389 388
@@ -578,7 +577,6 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { @@ -578,7 +577,6 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver {
578 //店铺过期日期 577 //店铺过期日期
579 DateTime edate = DateTime.fromMillisecondsSinceEpoch( 578 DateTime edate = DateTime.fromMillisecondsSinceEpoch(
580 int.parse(sellerVersionSunModel.edate!) * 1000); 579 int.parse(sellerVersionSunModel.edate!) * 1000);
581 -  
582 580
583 //当前日期 581 //当前日期
584 final datenow = DateTime.now(); 582 final datenow = DateTime.now();
@@ -816,7 +814,7 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { @@ -816,7 +814,7 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver {
816 } 814 }
817 815
818 _initNotification() async { 816 _initNotification() async {
819 - Map? param = await Tools().getIntent() ; 817 + Map? param = await Tools().getIntent();
820 _getIntent(param); 818 _getIntent(param);
821 } 819 }
822 820
@@ -894,7 +892,8 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { @@ -894,7 +892,8 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver {
894 NavigatorUtil.goOnlineCheckDetailPage(context, 892 NavigatorUtil.goOnlineCheckDetailPage(context,
895 rid: notifyParam["rid"], fromNotify: true); 893 rid: notifyParam["rid"], fromNotify: true);
896 Map<String, String?> params = { 894 Map<String, String?> params = {
897 - "sid": Provider.of<UserModel>(context, listen: false).user!.sellerid, 895 + "sid":
  896 + Provider.of<UserModel>(context, listen: false).user!.sellerid,
898 "id": notifyParam['mid'], 897 "id": notifyParam['mid'],
899 "status": "is_read" 898 "status": "is_read"
900 }; 899 };
@@ -907,7 +906,8 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { @@ -907,7 +906,8 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver {
907 NavigatorUtil.goInvoiceDetailPage(context, 906 NavigatorUtil.goInvoiceDetailPage(context,
908 rid: '${notifyParam["rid"]}', fromNotify: true); 907 rid: '${notifyParam["rid"]}', fromNotify: true);
909 Map<String, String?> params = { 908 Map<String, String?> params = {
910 - "sid": Provider.of<UserModel>(context, listen: false).user!.sellerid, 909 + "sid":
  910 + Provider.of<UserModel>(context, listen: false).user!.sellerid,
911 "id": notifyParam['mid'], 911 "id": notifyParam['mid'],
912 "status": "is_read" 912 "status": "is_read"
913 }; 913 };
@@ -926,7 +926,8 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { @@ -926,7 +926,8 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver {
926 .millisecondsSinceEpoch, 926 .millisecondsSinceEpoch,
927 solt: notifyParam['ddate_solt']); 927 solt: notifyParam['ddate_solt']);
928 Map<String, String?> params = { 928 Map<String, String?> params = {
929 - "sid": Provider.of<UserModel>(context, listen: false).user!.sellerid, 929 + "sid":
  930 + Provider.of<UserModel>(context, listen: false).user!.sellerid,
930 "id": notifyParam['mid'], 931 "id": notifyParam['mid'],
931 "status": "is_read" 932 "status": "is_read"
932 }; 933 };
@@ -950,7 +951,8 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { @@ -950,7 +951,8 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver {
950 Provider.of<MessageDialogModel>(context, listen: false); 951 Provider.of<MessageDialogModel>(context, listen: false);
951 952
952 Map<String, String?> params = { 953 Map<String, String?> params = {
953 - "sid": Provider.of<UserModel>(context, listen: false).user!.sellerid, 954 + "sid":
  955 + Provider.of<UserModel>(context, listen: false).user!.sellerid,
954 "id": notifyParam['mid'], 956 "id": notifyParam['mid'],
955 "status": "is_read" 957 "status": "is_read"
956 }; 958 };
@@ -1002,7 +1004,8 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { @@ -1002,7 +1004,8 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver {
1002 // bus.emit("remove_untreated_message_order", notifyParam["rid"]); 1004 // bus.emit("remove_untreated_message_order", notifyParam["rid"]);
1003 1005
1004 Map<String, String?> params = { 1006 Map<String, String?> params = {
1005 - "sid": Provider.of<UserModel>(context, listen: false).user!.sellerid, 1007 + "sid":
  1008 + Provider.of<UserModel>(context, listen: false).user!.sellerid,
1006 "id": notifyParam['mid'], 1009 "id": notifyParam['mid'],
1007 "status": "is_read" 1010 "status": "is_read"
1008 }; 1011 };
@@ -1086,6 +1089,7 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { @@ -1086,6 +1089,7 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver {
1086 // } 1089 // }
1087 // } 1090 // }
1088 // App.sp.setBool("h_notification", true); 1091 // App.sp.setBool("h_notification", true);
  1092 + if (!mounted) return;
1089 1093
1090 /// 开启DEBUG 1094 /// 开启DEBUG
1091 tpush.setEnableDebug(false); 1095 tpush.setEnableDebug(false);
@@ -1195,12 +1199,14 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { @@ -1195,12 +1199,14 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver {
1195 // /// 在此可设置应用角标 1199 // /// 在此可设置应用角标
1196 // tpush.setAppBadge(0); 1200 // tpush.setAppBadge(0);
1197 }, 1201 },
1198 - /// V1.2.8开始返回类型由String->Map,新增code及type标识! 1202 +
  1203 + /// V1.2.8开始返回类型由String->Map,新增code及type标识!
1199 xgPushDidBindWithIdentifier: (Map<String, dynamic> result) async { 1204 xgPushDidBindWithIdentifier: (Map<String, dynamic> result) async {
1200 print("flutter xgPushDidBindWithIdentifier: $result"); 1205 print("flutter xgPushDidBindWithIdentifier: $result");
1201 // _showAlert(result["msg"]); 1206 // _showAlert(result["msg"]);
1202 }, 1207 },
1203 - /// V1.2.8开始返回类型由String->Map,新增code及type标识! 1208 +
  1209 + /// V1.2.8开始返回类型由String->Map,新增code及type标识!
1204 xgPushDidUnbindWithIdentifier: (Map<String, dynamic> result) async { 1210 xgPushDidUnbindWithIdentifier: (Map<String, dynamic> result) async {
1205 print("flutter xgPushDidUnbindWithIdentifier: $result"); 1211 print("flutter xgPushDidUnbindWithIdentifier: $result");
1206 // _showAlert(result["msg"]); 1212 // _showAlert(result["msg"]);
@@ -1211,6 +1217,7 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { @@ -1211,6 +1217,7 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver {
1211 print("flutter xgPushDidUpdatedBindedIdentifier: $result"); 1217 print("flutter xgPushDidUpdatedBindedIdentifier: $result");
1212 // _showAlert(result["msg"]); 1218 // _showAlert(result["msg"]);
1213 }, 1219 },
  1220 +
1214 /// V1.2.8开始返回类型由String->Map,新增code及type标识! 1221 /// V1.2.8开始返回类型由String->Map,新增code及type标识!
1215 xgPushDidClearAllIdentifiers: (Map<String, dynamic> result) async { 1222 xgPushDidClearAllIdentifiers: (Map<String, dynamic> result) async {
1216 print("flutter xgPushDidClearAllIdentifiers: $result"); 1223 print("flutter xgPushDidClearAllIdentifiers: $result");
@@ -1477,7 +1484,12 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { @@ -1477,7 +1484,12 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver {
1477 1484
1478 /// 启动TPNS服务 1485 /// 启动TPNS服务
1479 LogUtil.v("register:${xgCount.toString()}"); 1486 LogUtil.v("register:${xgCount.toString()}");
1480 - tpush.startXg("1600012876", "INUIMFK21WGH"); 1487 + // tpush.startXg("1600012876", "INUIMFK21WGH");
  1488 + if (Platform.isIOS) {
  1489 + tpush.startXg("1600012876", "INUIMFK21WGH");
  1490 + } else {
  1491 + tpush.startXg("1500012875", "AVR2GJERH0HC");
  1492 + }
1481 xgCount++; 1493 xgCount++;
1482 } 1494 }
1483 1495