Merge remote-tracking branch 'origin/develop_liyi' into develop_liyi

This commit is contained in:
liyi 2025-02-21 15:55:49 +08:00
commit 6d720e92a2
9 changed files with 55 additions and 23 deletions

View File

@ -357,4 +357,9 @@ dependencies {
implementation 'com.umeng.umsdk:common:9.7.9' implementation 'com.umeng.umsdk:common:9.7.9'
implementation 'com.umeng.umsdk:asms:1.8.5' implementation 'com.umeng.umsdk:asms:1.8.5'
//</cn> //</cn>
//<com>
implementation 'cn.jiguang.sdk.plugin:fcm:5.2.3'
implementation 'com.google.firebase:firebase-messaging:23.0.5'
//</com>
} }

View File

@ -78,6 +78,8 @@
<meta-data <meta-data
android:name="flutterEmbedding" android:name="flutterEmbedding"
android:value="2" /> android:value="2" />
<meta-data android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@mipmap/ic_launcher" />
<meta-data <meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id" android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="1" /> <!-- 将您的通知渠道ID替换为您的实际ID --> android:value="1" /> <!-- 将您的通知渠道ID替换为您的实际ID -->

View File

@ -603,7 +603,7 @@
"开门方式": "開門方法", "开门方式": "開門方法",
"请选择": "請選擇", "请选择": "請選擇",
"家人": "家人", "家人": "家人",
"保存": "", "保存": "保存",
"APP推送": "APP推送", "APP推送": "APP推送",
"管理员": "管理", "管理员": "管理",
"未启用": "未啟用", "未启用": "未啟用",

View File

@ -61,7 +61,7 @@ FutureOr<void> main() async {
// ], child: MyApp(isLogin: isLogin))); // ], child: MyApp(isLogin: isLogin)));
runApp(MyApp(isLogin: isLogin)); runApp(MyApp(isLogin: isLogin));
}, onException: (FlutterErrorDetails details) async { }, onException: (FlutterErrorDetails details) async {
debugPrint("FlutterErrorDetails $details"); debugPrint('FlutterErrorDetails ${details.exceptionAsString()}');
}); });
if (AppPlatform.isAndroid) { if (AppPlatform.isAndroid) {

View File

@ -91,22 +91,24 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle
// //
Future<void> _showTalkRequestNotification( Future<void> _showTalkRequestNotification(
{required String talkObjectName}) async { {required String talkObjectName}) async {
final Map<String, dynamic> message = { if (Platform.isAndroid) {
'platform': 'all', final Map<String, dynamic> message = {
'audience': 'all', 'platform': 'all',
'notification': <String, Map<String, Object>>{ 'audience': 'all',
'android': <String, Object>{ 'notification': <String, Map<String, Object>>{
'title': '呼叫提醒'.tr, 'android': <String, Object>{
'alert': '${'收到来自'.tr}($talkObjectName)${'锁的呼叫'.tr}', 'title': '呼叫提醒'.tr,
'extras': <String, String>{ 'alert': '${'收到来自'.tr}($talkObjectName)${'锁的呼叫'.tr}',
'image_url': 'extras': <String, String>{
'https://image.baidu.com/search/detail?ct=503316480&z=0&ipn=d&word=视频通话图标&step_word=&hs=0&pn=18&spn=0&di=7456461798821068801&pi=0&rn=1&tn=baiduimagedetail&is=0%2C0&istype=0&ie=utf-8&oe=utf-8&in=&cl=2&lm=-1&st=undefined&cs=3670633426%2C2210940696&os=2119936476%2C3383901310&simid=3670633426%2C2210940696&adpicid=0&lpn=0&ln=1216&fr=&fmq=1738909566404_R&fm=&ic=undefined&s=undefined&hd=undefined&latest=undefined&copyright=undefined&se=&sme=&tab=0&width=undefined&height=undefined&face=undefined&ist=&jit=&cg=&bdtype=0&oriquery=&objurl=https%3A%2F%2Ftenfei03.cfp.cn%2Fcreative%2Fvcg%2Fnowarter800%2Fnew%2FVCG211249198901.jpg&fromurl=ippr_z2C%24qAzdH3FAzdH3Fooo_z%26e3Bev2_z%26e3Bv54AzdH3Fv6jwptejAzdH3F8dnla9lla0&gsm=1e&rpstart=0&rpnum=0&islist=&querylist=&nojc=undefined&dyTabStr=MCwxMiwzLDEsMiwxMyw3LDYsNSw5&lid=9610633549467928081' 'image_url':
'https://image.baidu.com/search/detail?ct=503316480&z=0&ipn=d&word=视频通话图标&step_word=&hs=0&pn=18&spn=0&di=7456461798821068801&pi=0&rn=1&tn=baiduimagedetail&is=0%2C0&istype=0&ie=utf-8&oe=utf-8&in=&cl=2&lm=-1&st=undefined&cs=3670633426%2C2210940696&os=2119936476%2C3383901310&simid=3670633426%2C2210940696&adpicid=0&lpn=0&ln=1216&fr=&fmq=1738909566404_R&fm=&ic=undefined&s=undefined&hd=undefined&latest=undefined&copyright=undefined&se=&sme=&tab=0&width=undefined&height=undefined&face=undefined&ist=&jit=&cg=&bdtype=0&oriquery=&objurl=https%3A%2F%2Ftenfei03.cfp.cn%2Fcreative%2Fvcg%2Fnowarter800%2Fnew%2FVCG211249198901.jpg&fromurl=ippr_z2C%24qAzdH3FAzdH3Fooo_z%26e3Bev2_z%26e3Bv54AzdH3Fv6jwptejAzdH3F8dnla9lla0&gsm=1e&rpstart=0&rpnum=0&islist=&querylist=&nojc=undefined&dyTabStr=MCwxMiwzLDEsMiwxMyw3LDYsNSw5&lid=9610633549467928081'
}
} }
} }
} };
};
XSJPushProvider().showCustomNotification(message); XSJPushProvider().showCustomNotification(message);
}
/* /*
const AndroidNotificationDetails androidPlatformChannelSpecifics = const AndroidNotificationDetails androidPlatformChannelSpecifics =
AndroidNotificationDetails('1', 'flutter_channel', AndroidNotificationDetails('1', 'flutter_channel',

View File

@ -3,6 +3,7 @@ import 'dart:io';
import 'dart:ui' as ui; import 'dart:ui' as ui;
import 'dart:math'; // Import the math package to use sqrt import 'dart:math'; // Import the math package to use sqrt
import 'package:flutter/foundation.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_pcm_sound/flutter_pcm_sound.dart'; import 'package:flutter_pcm_sound/flutter_pcm_sound.dart';
@ -573,12 +574,18 @@ class TalkViewLogic extends BaseGetXController {
} }
} }
//
Future<void> _onFrame(List<int> frame) async { Future<void> _onFrame(List<int> frame) async {
// 线
// final processedFrame = await compute(preprocessAudio, frame);
// final list = listLinearToALaw(processedFrame);
final List<int> processedFrame = preprocessAudio(frame); final List<int> processedFrame = preprocessAudio(frame);
final List<int> list = listLinearToALaw(processedFrame); final List<int> list = listLinearToALaw(processedFrame);
final int ms = DateTime.now().millisecondsSinceEpoch - final int ms = DateTime.now().millisecondsSinceEpoch -
state.startRecordingAudioTime.value.millisecondsSinceEpoch; state.startRecordingAudioTime.value.millisecondsSinceEpoch;
//
// UDP
await StartChartManage().sendTalkDataMessage( await StartChartManage().sendTalkDataMessage(
talkData: TalkData( talkData: TalkData(
content: list, content: list,
@ -588,8 +595,8 @@ class TalkViewLogic extends BaseGetXController {
); );
} }
//
void _onError(VoiceProcessorException error) { void _onError(VoiceProcessorException error) {
// state.errorMessage.value = error.message!;
AppLog.log(error.message!); AppLog.log(error.message!);
} }
@ -598,7 +605,7 @@ class TalkViewLogic extends BaseGetXController {
final List<int> processedList = []; final List<int> processedList = [];
for (int pcmVal in pcmList) { for (int pcmVal in pcmList) {
// 0 // 0
if (pcmVal.abs() < 300) { if (pcmVal.abs() < 200) {
pcmVal = 0; pcmVal = 0;
} }
processedList.add(pcmVal); processedList.add(pcmVal);

View File

@ -1,5 +1,6 @@
import 'dart:io'; import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:jpush_flutter/jpush_flutter.dart'; import 'package:jpush_flutter/jpush_flutter.dart';
import 'package:star_lock/flavors.dart'; import 'package:star_lock/flavors.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEditAccount/minePersonInfoEditAccount/mineUnbindPhoneOrEmail_entity.dart'; import 'package:star_lock/mine/minePersonInfo/minePersonInfoEditAccount/minePersonInfoEditAccount/mineUnbindPhoneOrEmail_entity.dart';
@ -49,28 +50,39 @@ class XSJPushProvider {
// //
void addJPushEventHandler() { void addJPushEventHandler() {
jpush.addEventHandler( jpush.addEventHandler(
onCommandResult: (Map<String, dynamic> message) async {
AppLog.log('onCommandResult: $message');
debugPrint("addJPushEventHandler onCommandResult:$message");
},
onReceiveNotification: (Map<String, dynamic> message) async { onReceiveNotification: (Map<String, dynamic> message) async {
AppLog.log('onReceiveNotification: $message'); AppLog.log('onReceiveNotification: $message');
debugPrint("addJPushEventHandler onReceiveNotification:$message");
// showCustomNotification(message); // showCustomNotification(message);
}, },
onOpenNotification: (Map<String, dynamic> message) async { onOpenNotification: (Map<String, dynamic> message) async {
AppLog.log('onOpenNotification: $message'); AppLog.log('onOpenNotification: $message');
debugPrint("addJPushEventHandler onOpenNotification:$message");
}, },
onReceiveMessage: (Map<String, dynamic> message) async { onReceiveMessage: (Map<String, dynamic> message) async {
AppLog.log('onReceiveMessage: $message'); AppLog.log('onReceiveMessage: $message');
debugPrint("addJPushEventHandler onReceiveMessage:$message");
// //
MessageManagement.shunting(message); MessageManagement.shunting(message);
}, },
onReceiveNotificationAuthorization: (Map<String, dynamic> message) async { onReceiveNotificationAuthorization: (Map<String, dynamic> message) async {
AppLog.log('onReceiveNotificationAuthorization: $message'); AppLog.log('onReceiveNotificationAuthorization: $message');
debugPrint(
"addJPushEventHandler onReceiveNotificationAuthorization:$message");
}, },
onInAppMessageShow: (Map<String, dynamic> message) async { onInAppMessageShow: (Map<String, dynamic> message) async {
AppLog.log('onInAppMessageShow: $message'); AppLog.log('onInAppMessageShow: $message');
debugPrint("addJPushEventHandler onInAppMessageShow:$message");
}, },
onConnected: (Map<String, dynamic> message) async { onConnected: (Map<String, dynamic> message) async {
//id //id
final String rid = await jpush.getRegistrationID(); final String rid = await jpush.getRegistrationID();
AppLog.log('onConnected registration id : $rid'); AppLog.log('onConnected registration id : $rid');
debugPrint("addJPushEventHandler onConnected:$message");
await Storage.setString(pushDeviceID, rid); await Storage.setString(pushDeviceID, rid);
await pushBindDeviceID(rid); await pushBindDeviceID(rid);

View File

@ -991,10 +991,11 @@ packages:
jpush_flutter: jpush_flutter:
dependency: "direct main" dependency: "direct main"
description: description:
name: jpush_flutter path: "."
sha256: bb29ce650c6765a54ecbdd8f448840ecea83b4e24564e554d11eba20ed3b37d9 ref: main
url: "https://pub.dev" resolved-ref: aa93729f48762421658675800be68aee27b6d8fb
source: hosted url: "git@code-internal.star-lock.cn:StarlockTeam/jpush_flutter.git"
source: git
version: "2.5.8" version: "2.5.8"
js: js:
dependency: transitive dependency: transitive

View File

@ -211,7 +211,10 @@ dependencies:
cached_network_image: ^3.2.0 cached_network_image: ^3.2.0
webview_flutter: ^4.5.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 video_player: ^2.9.2