diff --git a/android/app/build.gradle b/android/app/build.gradle index 84b9b089..cd368efc 100755 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -184,12 +184,6 @@ android { OPPO_APPKEY : "OP-47f668c9943248118502aa58d066393b", OPPO_APPID : "OP-31726001", OPPO_APPSECRET: "OP-05723986bba64183a71530b496922450", - // VIVO_APPKEY : "vivo的APPKEY", - // VIVO_APPID : "vivo的APPID", - HONOR_APPID : "110798531", - OPPO_APPKEY : "OP-47f668c9943248118502aa58d066393b", - OPPO_APPID : "OP-31726001", - OPPO_APPSECRET: "OP-05723986bba64183a71530b496922450", VIVO_APPKEY : "75fe8e570425b714e08d0390b14797cb", VIVO_APPID : "105752244", HONOR_APPID : "104458196", diff --git a/android/app/libs/HiPushSDK-7.0.61.303.aar b/android/app/libs/HiPushSDK-7.0.61.303.aar new file mode 100644 index 00000000..2b7d2e6b Binary files /dev/null and b/android/app/libs/HiPushSDK-7.0.61.303.aar differ diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 07c09ea3..7cea66a7 100755 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -56,6 +56,8 @@ android:name="android.permission.QUERY_ALL_PACKAGES" tools:node="remove" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/login/login/starLock_login_state.dart b/lib/login/login/starLock_login_state.dart index 9521398c..793ae233 100755 --- a/lib/login/login/starLock_login_state.dart +++ b/lib/login/login/starLock_login_state.dart @@ -19,7 +19,12 @@ class StarLockLoginState { FocusNode emailOrPhoneFocusNode = FocusNode(); FocusNode pwdFocusNode = FocusNode(); - RxMap deviceInfoMap = {}.obs; + RxMap deviceInfoMap = { + 'deviceBrand': '暂无', + 'deviceModel': '暂无', + 'deviceVersion': '暂无', + 'deviceType': 0 + }.obs; StarLockLoginState() { // emailOrPhone.value = StoreService.to.getLastUserAccount() as String; diff --git a/lib/login/register/starLock_register_logic.dart b/lib/login/register/starLock_register_logic.dart index 5119acc4..7eb4fa3f 100755 --- a/lib/login/register/starLock_register_logic.dart +++ b/lib/login/register/starLock_register_logic.dart @@ -57,7 +57,6 @@ class StarLockRegisterLogic extends BaseGetXController { Storage.saveLoginData(entity.data); Storage.setBool(saveIsVip, entity.data!.isVip == 1); eventBus.fire(MineInfoChangeRefreshUI()); - XSJPushProvider().bindDeviceID(); XSJPushProvider().initLocalNotification(isCancelLocalPush: false); Get.offNamedUntil(Routers.starLockMain, (Route route) => false); BlueManage().scanDevices.clear(); //清除设备缓存 diff --git a/lib/main/lockMian/lockMain/lockMain_logic.dart b/lib/main/lockMian/lockMain/lockMain_logic.dart index 8c60f6f1..6234c12c 100755 --- a/lib/main/lockMian/lockMain/lockMain_logic.dart +++ b/lib/main/lockMian/lockMain/lockMain_logic.dart @@ -29,8 +29,10 @@ class LockMainLogic extends BaseGetXController { final List> _subscriptions = >[]; - Future getStarLockInfo({bool isUnShowLoading = false}) async { - final LockListInfoEntity entity = await ApiRepository.to.getStarLockListInfo( + Future getStarLockInfo( + {bool isUnShowLoading = false}) async { + final LockListInfoEntity entity = + await ApiRepository.to.getStarLockListInfo( pageNo: pageNo, pageSize: 50, isUnShowLoading: isUnShowLoading, @@ -44,13 +46,12 @@ class LockMainLogic extends BaseGetXController { } Future updateZoneOffsetsAndLanguages() async { - final LoginEntity entity = await ApiRepository.to.updateZoneOffsetsAndLanguages( + final LoginEntity entity = + await ApiRepository.to.updateZoneOffsetsAndLanguages( timezoneOffset: DateTime.now().timeZoneOffset.inSeconds, // language: '' ); - if (entity.errorCode!.codeIsSuccessful) { - - } + if (entity.errorCode!.codeIsSuccessful) {} return entity; } @@ -88,18 +89,22 @@ class LockMainLogic extends BaseGetXController { }); } - if(state.dataLength.value == 1){ + if (state.dataLength.value == 1) { if (Get.isRegistered()) { //设置控制器数据并刷新 // AppLog.log('检测控制器是否存 调用了 setLockListInfoGroupEntity'); - Get.find().loadData(lockListInfoItemEntity: entity.groupList![0].lockList![0], isOnlyOneData: true); + Get.find().loadData( + lockListInfoItemEntity: entity.groupList![0].lockList![0], + isOnlyOneData: true); } else { //延迟加载 Future.delayed(200.milliseconds, () { if (Get.isRegistered()) { //设置控制器数据并刷新 // AppLog.log('检测控制器是否存 延迟调用了 setLockListInfoGroupEntity'); - Get.find().loadData(lockListInfoItemEntity: entity.groupList![0].lockList![0], isOnlyOneData: true); + Get.find().loadData( + lockListInfoItemEntity: entity.groupList![0].lockList![0], + isOnlyOneData: true); } }); } @@ -300,7 +305,6 @@ class LockMainLogic extends BaseGetXController { // 初始化JPush服务并绑定设备ID final XSJPushProvider jpushProvider = XSJPushProvider(); await jpushProvider.initJPushService(); - await jpushProvider.bindDeviceID(); await jpushProvider.initLocalNotification(isCancelLocalPush: false); // 开启UDP diff --git a/lib/main/lockMian/lockMain/xhj/lockMain_xhj_logic.dart b/lib/main/lockMian/lockMain/xhj/lockMain_xhj_logic.dart index 3b5c78fb..77c18a63 100755 --- a/lib/main/lockMian/lockMain/xhj/lockMain_xhj_logic.dart +++ b/lib/main/lockMian/lockMain/xhj/lockMain_xhj_logic.dart @@ -61,7 +61,6 @@ class LockMainXHJLogic extends BaseGetXController { // 初始化JPush服务并绑定设备ID final XSJPushProvider jpushProvider = XSJPushProvider(); await jpushProvider.initJPushService(); - await jpushProvider.bindDeviceID(); await jpushProvider.initLocalNotification(isCancelLocalPush: false); } diff --git a/lib/tools/push/xs_jPhush.dart b/lib/tools/push/xs_jPhush.dart index b4defb24..7c72a424 100755 --- a/lib/tools/push/xs_jPhush.dart +++ b/lib/tools/push/xs_jPhush.dart @@ -49,39 +49,33 @@ class XSJPushProvider { //极光推送事件处理方法 void addJPushEventHandler() { jpush.addEventHandler( - onReceiveNotification: (Map message) async { - AppLog.log('onReceiveNotification: $message'); - }, onOpenNotification: (Map message) async { - AppLog.log('onOpenNotification: $message'); - }, onReceiveMessage: (Map message) async { - AppLog.log('onReceiveMessage: $message'); - //这里接收自定义消息 - MessageManagement.shunting(message); - }, onReceiveNotificationAuthorization: - (Map message) async { - AppLog.log('onReceiveNotificationAuthorization: $message'); - }, onInAppMessageShow: (Map message) async { - AppLog.log('onInAppMessageShow: $message'); - }); - } + onReceiveNotification: (Map message) async { + AppLog.log('onReceiveNotification: $message'); + }, + onOpenNotification: (Map message) async { + AppLog.log('onOpenNotification: $message'); + }, + onReceiveMessage: (Map message) async { + AppLog.log('onReceiveMessage: $message'); + //这里接收自定义消息 + MessageManagement.shunting(message); + }, + onReceiveNotificationAuthorization: (Map message) async { + AppLog.log('onReceiveNotificationAuthorization: $message'); + }, + onInAppMessageShow: (Map message) async { + AppLog.log('onInAppMessageShow: $message'); + }, + onConnected: (Map message) async { + //绑定设备id + final String rid = await jpush.getRegistrationID(); + AppLog.log('onConnected registration id : $rid'); + await Storage.setString(pushDeviceID, rid); + await pushBindDeviceID(rid, Platform.isAndroid ? 10 : 20); - //绑定设备ID - Future bindDeviceID() async { - try { - AppLog.log('Fetching registration ID...'); - String rid; - rid = await jpush.getRegistrationID(); - if (rid.isEmpty) { - AppLog.log('Registration ID is empty.'); - rid = await jpush.getRegistrationID(); - return; - } - AppLog.log('flutter get registration id : $rid'); - await Storage.setString(pushDeviceID, rid); - await pushBindDeviceID(rid, Platform.isAndroid ? 10 : 20); - } catch (e) { - AppLog.log('Error getting registration ID: $e'); - } + return Future.value(); + }, + ); } Future pushBindDeviceID(String deviceID, int deviceType) async {