diff --git a/android/app/build.gradle b/android/app/build.gradle
index 41903854..0386ff73 100755
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -357,4 +357,9 @@ dependencies {
implementation 'com.umeng.umsdk:common:9.7.9'
implementation 'com.umeng.umsdk:asms:1.8.5'
//
+ //
+ implementation 'cn.jiguang.sdk.plugin:fcm:5.2.3'
+ implementation 'com.google.firebase:firebase-messaging:23.0.5'
+ //
+
}
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index db2e332c..236a8fbe 100755
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -78,6 +78,8 @@
+
diff --git a/lib/main.dart b/lib/main.dart
index b1785d2e..872b7a26 100755
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -61,7 +61,7 @@ FutureOr main() async {
// ], child: MyApp(isLogin: isLogin)));
runApp(MyApp(isLogin: isLogin));
}, onException: (FlutterErrorDetails details) async {
- debugPrint("FlutterErrorDetails $details");
+ debugPrint('FlutterErrorDetails ${details.exceptionAsString()}');
});
if (AppPlatform.isAndroid) {
diff --git a/lib/talk/starChart/views/talkView/talk_view_logic.dart b/lib/talk/starChart/views/talkView/talk_view_logic.dart
index 4d468fe8..5033bca3 100644
--- a/lib/talk/starChart/views/talkView/talk_view_logic.dart
+++ b/lib/talk/starChart/views/talkView/talk_view_logic.dart
@@ -498,18 +498,15 @@ class TalkViewLogic extends BaseGetXController {
final lockPeerId = StartChartManage().lockPeerId;
final lockListPeerId = StartChartManage().lockListPeerId;
int lockId = lockDetailState.keyInfos.value.lockId ?? 0;
- if (lockListPeerId.length == 0) {
- // 如果锁列表没有获取到peerId,代表只有一个锁,直接使用锁详情的lockId
- lockId = lockDetailState.keyInfos.value.lockId ?? 0;
- } else {
- // 如果锁列表获取到peerId,代表有多个锁,使用锁列表的peerId
- // 从列表中遍历出对应的peerId
- lockListPeerId.forEach((element) {
- if (element.network?.peerId == lockPeerId) {
- lockId = element.lockId ?? 0;
- }
- });
- }
+
+ // 如果锁列表获取到peerId,代表有多个锁,使用锁列表的peerId
+ // 从列表中遍历出对应的peerId
+ lockListPeerId.forEach((element) {
+ if (element.network?.peerId == lockPeerId) {
+ lockId = element.lockId ?? 0;
+ }
+ });
+
final LockSetInfoEntity lockSetInfoEntity =
await ApiRepository.to.getLockSettingInfoData(
lockId: lockId.toString(),
@@ -615,6 +612,7 @@ class TalkViewLogic extends BaseGetXController {
}
return processedList;
}
+
//test测试降噪算法
// List preprocessAudio(List pcmList) {
// final List processedList = [];
diff --git a/lib/tools/push/xs_jPhush.dart b/lib/tools/push/xs_jPhush.dart
index bbeaa07a..3ce9adf3 100755
--- a/lib/tools/push/xs_jPhush.dart
+++ b/lib/tools/push/xs_jPhush.dart
@@ -1,5 +1,6 @@
import 'dart:io';
+import 'package:flutter/foundation.dart';
import 'package:jpush_flutter/jpush_flutter.dart';
import 'package:star_lock/flavors.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEditAccount/minePersonInfoEditAccount/mineUnbindPhoneOrEmail_entity.dart';
@@ -49,28 +50,39 @@ class XSJPushProvider {
//极光推送事件处理方法
void addJPushEventHandler() {
jpush.addEventHandler(
+ onCommandResult: (Map message) async {
+ AppLog.log('onCommandResult: $message');
+ debugPrint("addJPushEventHandler onCommandResult:$message");
+ },
onReceiveNotification: (Map message) async {
AppLog.log('onReceiveNotification: $message');
+ debugPrint("addJPushEventHandler onReceiveNotification:$message");
// showCustomNotification(message);
},
onOpenNotification: (Map message) async {
AppLog.log('onOpenNotification: $message');
+ debugPrint("addJPushEventHandler onOpenNotification:$message");
},
onReceiveMessage: (Map message) async {
AppLog.log('onReceiveMessage: $message');
+ debugPrint("addJPushEventHandler onReceiveMessage:$message");
//这里接收自定义消息
MessageManagement.shunting(message);
},
onReceiveNotificationAuthorization: (Map message) async {
AppLog.log('onReceiveNotificationAuthorization: $message');
+ debugPrint(
+ "addJPushEventHandler onReceiveNotificationAuthorization:$message");
},
onInAppMessageShow: (Map message) async {
AppLog.log('onInAppMessageShow: $message');
+ debugPrint("addJPushEventHandler onInAppMessageShow:$message");
},
onConnected: (Map message) async {
//绑定设备id
final String rid = await jpush.getRegistrationID();
AppLog.log('onConnected registration id : $rid');
+ debugPrint("addJPushEventHandler onConnected:$message");
await Storage.setString(pushDeviceID, rid);
await pushBindDeviceID(rid);
diff --git a/pubspec.lock b/pubspec.lock
index 1f831260..f09c8feb 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -991,10 +991,11 @@ packages:
jpush_flutter:
dependency: "direct main"
description:
- name: jpush_flutter
- sha256: bb29ce650c6765a54ecbdd8f448840ecea83b4e24564e554d11eba20ed3b37d9
- url: "https://pub.dev"
- source: hosted
+ path: "."
+ ref: main
+ resolved-ref: aa93729f48762421658675800be68aee27b6d8fb
+ url: "git@code-internal.star-lock.cn:StarlockTeam/jpush_flutter.git"
+ source: git
version: "2.5.8"
js:
dependency: transitive
diff --git a/pubspec.yaml b/pubspec.yaml
index 5473124e..9109e0a9 100755
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -211,7 +211,10 @@ dependencies:
cached_network_image: ^3.2.0
webview_flutter: ^4.5.0
- jpush_flutter: ^2.5.1
+ jpush_flutter:
+ git:
+ url: git@code-internal.star-lock.cn:StarlockTeam/jpush_flutter.git
+ ref: main
#视频播放器
video_player: ^2.9.2