Merge remote-tracking branch 'origin/develop_liyi' into develop_liyi
This commit is contained in:
commit
214ae198d9
BIN
android/app/src/main/res/raw/ring_wx.mp3
Normal file
BIN
android/app/src/main/res/raw/ring_wx.mp3
Normal file
Binary file not shown.
@ -26,21 +26,21 @@
|
||||
"SG_back":"connect-ws-dra.hispace.dbankcloud.com"
|
||||
},
|
||||
"client":{
|
||||
"cp_id":"30086000752967166",
|
||||
"product_id":"388421841222116270",
|
||||
"client_id":"1406555529261648640",
|
||||
"client_secret":"843E8191B02B692239726CF0ED990E1EC2B31928F825AA012B932A128FD2C516",
|
||||
"project_id":"388421841222116270",
|
||||
"app_id":"110798531",
|
||||
"api_key":"DQEDAALnPCtuCgoYOyZfsIDa9/YZZhQ+buDGpypeurXhQUGMajWcVyYLQgXXqV3x2HbI6oyG+Wm2Gf+1hPs6j+wA3B6ylYAXG4aAQA==",
|
||||
"cp_id":"30086000764882919",
|
||||
"product_id":"388421841222019909",
|
||||
"client_id":"1376040077926370048",
|
||||
"client_secret":"FE068E768F2B897A291DFFD186E0C0E495BE4BE6CCD7C5973B6C02ADF9178916",
|
||||
"project_id":"388421841222019909",
|
||||
"app_id":"110413691",
|
||||
"api_key":"DAEDAG1Mu4qubka2IheS5XVoQQIyqAr2tU+VyLcUukdN4iHjP9FZRI16fUIhWz+lsz8si57hQ/gjoNNvQBmgglsT5jnXFcnY4nF1wQ==",
|
||||
"package_name":"com.skychip.lock"
|
||||
},
|
||||
"oauth_client":{
|
||||
"client_id":"110798531",
|
||||
"client_id":"110413691",
|
||||
"client_type":1
|
||||
},
|
||||
"app_info":{
|
||||
"app_id":"110798531",
|
||||
"app_id":"110413691",
|
||||
"package_name":"com.skychip.lock"
|
||||
},
|
||||
"service":{
|
||||
@ -81,15 +81,15 @@
|
||||
{
|
||||
"package_name":"com.skychip.lock",
|
||||
"client":{
|
||||
"app_id":"110798531"
|
||||
"app_id":"110413691"
|
||||
},
|
||||
"app_info":{
|
||||
"package_name":"com.skychip.lock",
|
||||
"app_id":"110798531"
|
||||
"app_id":"110413691"
|
||||
},
|
||||
"oauth_client":{
|
||||
"client_type":1,
|
||||
"client_id":"110798531"
|
||||
"client_id":"110413691"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 78 KiB |
BIN
images/call_me_icon.png
Normal file
BIN
images/call_me_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 55 KiB |
@ -10,6 +10,7 @@ import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/login/register/entity/SendValidationCodeEntity.dart';
|
||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||
import 'package:star_lock/tools/push/notification_service.dart';
|
||||
import 'package:star_lock/tools/push/xs_jPhush.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
@ -70,7 +71,7 @@ class StarLockRegisterLogic extends BaseGetXController {
|
||||
Storage.saveLoginData(entity.data);
|
||||
Storage.setBool(saveIsVip, entity.data!.isVip == 1);
|
||||
eventBus.fire(MineInfoChangeRefreshUI());
|
||||
XSJPushProvider().initLocalNotification(isCancelLocalPush: false);
|
||||
NotificationService().init(); // 初始化通知服务
|
||||
Get.offNamedUntil(Routers.starLockMain, (Route route) => false);
|
||||
BlueManage().scanDevices.clear(); //清除设备缓存
|
||||
} else {
|
||||
|
||||
@ -96,6 +96,5 @@ Future<void> privacySDKInitialization() async {
|
||||
// 初始化JPush服务
|
||||
final XSJPushProvider jpushProvider = XSJPushProvider();
|
||||
await jpushProvider.initJPushService();
|
||||
await jpushProvider.initLocalNotification(isCancelLocalPush: false);
|
||||
NotificationService().init(); // 初始化通知服务
|
||||
}
|
||||
|
||||
@ -14,6 +14,7 @@ import 'package:star_lock/main/lockMian/lockList/lockList_logic.dart';
|
||||
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
|
||||
import 'package:star_lock/talk/starChart/star_chart_manage.dart';
|
||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||
import 'package:star_lock/tools/push/notification_service.dart';
|
||||
import 'package:star_lock/tools/push/xs_jPhush.dart';
|
||||
import 'package:star_lock/tools/showTipView.dart';
|
||||
import 'package:star_lock/tools/store_service.dart';
|
||||
@ -92,7 +93,7 @@ class LockMainLogic extends BaseGetXController {
|
||||
// 初始化JPush服务并绑定设备ID
|
||||
final XSJPushProvider jpushProvider = XSJPushProvider();
|
||||
await jpushProvider.initJPushService();
|
||||
await jpushProvider.initLocalNotification(isCancelLocalPush: false);
|
||||
NotificationService().init(); // 初始化通知服务
|
||||
}
|
||||
|
||||
//绑定星图
|
||||
@ -364,7 +365,7 @@ class LockMainLogic extends BaseGetXController {
|
||||
// 初始化JPush服务并绑定设备ID
|
||||
final XSJPushProvider jpushProvider = XSJPushProvider();
|
||||
await jpushProvider.initJPushService();
|
||||
await jpushProvider.initLocalNotification(isCancelLocalPush: false);
|
||||
NotificationService().init(); // 初始化通知服务
|
||||
|
||||
// 开启UDP
|
||||
// AppLog.log('onReady() LockMainLogic');
|
||||
|
||||
@ -10,6 +10,7 @@ import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/talk/starChart/star_chart_manage.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/push/notification_service.dart';
|
||||
import 'package:star_lock/tools/push/xs_jPhush.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
@ -91,7 +92,7 @@ class LockMainXHJLogic extends BaseGetXController {
|
||||
// 初始化JPush服务并绑定设备ID
|
||||
final XSJPushProvider jpushProvider = XSJPushProvider();
|
||||
await jpushProvider.initJPushService();
|
||||
await jpushProvider.initLocalNotification(isCancelLocalPush: false);
|
||||
NotificationService().init(); // 初始化通知服务
|
||||
}
|
||||
|
||||
//绑定星图
|
||||
|
||||
@ -11,6 +11,7 @@ import 'package:star_lock/mine/mineSet/mineSet/mineSet_state.dart';
|
||||
import 'package:star_lock/mine/mineSet/mineSet/userSettingInfoEntity.dart';
|
||||
import 'package:star_lock/mine/mineSet/mineSet/weChatQRCodeEntity.dart';
|
||||
import 'package:star_lock/talk/starChart/star_chart_manage.dart';
|
||||
import 'package:star_lock/tools/push/notification_service.dart';
|
||||
import 'package:star_lock/tools/push/xs_jPhush.dart';
|
||||
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
@ -141,6 +142,9 @@ class MineSetLogic extends BaseGetXController {
|
||||
'logout_result': '成功',
|
||||
});
|
||||
|
||||
// 取消所有本地通知
|
||||
await NotificationService().cancelAllNotifications();
|
||||
|
||||
// UdpHelp().closeUDP();
|
||||
logOut();
|
||||
|
||||
@ -148,7 +152,6 @@ class MineSetLogic extends BaseGetXController {
|
||||
Get.updateLocale(Get.deviceLocale!);
|
||||
|
||||
BlueManage().disconnect();
|
||||
XSJPushProvider().initLocalNotification(isCancelLocalPush: true);
|
||||
StartChartManage().destruction();
|
||||
StartChartManage().closeUdpSocket();
|
||||
Get.offNamedUntil(Routers.starLockLoginPage, (Route route) => false);
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
@ -14,6 +15,7 @@ import 'package:star_lock/talk/starChart/proto/gateway_reset.pb.dart';
|
||||
import 'package:star_lock/talk/starChart/proto/generic.pb.dart';
|
||||
import 'package:star_lock/talk/starChart/proto/talk_expect.pb.dart';
|
||||
import 'package:star_lock/talk/starChart/proto/talk_request.pb.dart';
|
||||
import 'package:star_lock/tools/push/xs_jPhush.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
class UdpTalkRequestHandler extends ScpMessageBaseHandle
|
||||
@ -62,7 +64,10 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle
|
||||
// 发送预期数据、通知锁板需要获取视频数据
|
||||
_handleSendExpect();
|
||||
// 播放铃声
|
||||
playRingtone();
|
||||
//test:使用自定义铃声
|
||||
if (Platform.isIOS) {
|
||||
playRingtone();
|
||||
}
|
||||
// 显示状态栏弹窗
|
||||
_showTalkRequestNotification(talkObjectName: talkObjectName);
|
||||
// 设置为等待接听状态
|
||||
@ -78,9 +83,7 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle
|
||||
// 收到来电请求时进行本地通知
|
||||
Future<void> _showTalkRequestNotification(
|
||||
{required String talkObjectName}) async {
|
||||
/**
|
||||
*
|
||||
final Map<String, dynamic> message = {
|
||||
final Map<String, dynamic> message = {
|
||||
'platform': 'all',
|
||||
'audience': 'all',
|
||||
'notification': <String, Map<String, Object>>{
|
||||
@ -96,7 +99,7 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle
|
||||
};
|
||||
|
||||
XSJPushProvider().showCustomNotification(message);
|
||||
*/
|
||||
/*
|
||||
const AndroidNotificationDetails androidPlatformChannelSpecifics =
|
||||
AndroidNotificationDetails('1', 'flutter_channel',
|
||||
importance: Importance.max,
|
||||
@ -113,6 +116,7 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle
|
||||
await flutterLocalNotificationsPlugin.show(0, '呼叫提醒'.tr,
|
||||
'${'收到来自'.tr}($talkObjectName)${'锁的呼叫'.tr}。', platformChannelSpecifics,
|
||||
payload: 'item x');
|
||||
*/
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:audioplayers/audioplayers.dart';
|
||||
@ -76,7 +77,10 @@ class ScpMessageBaseHandle {
|
||||
|
||||
// 播放铃声
|
||||
void playRingtone() async {
|
||||
await audioManager.playRingtone();
|
||||
//test:使用自定义铃声
|
||||
if (Platform.isIOS) {
|
||||
await audioManager.playRingtone();
|
||||
}
|
||||
}
|
||||
|
||||
// 停止播放铃声
|
||||
|
||||
@ -9,4 +9,6 @@ class MessageConstant {
|
||||
static const int keyReceive = 40;
|
||||
//锁设置变更
|
||||
static const int lockSetChange = 50;
|
||||
//呼叫推送自定义大图模式
|
||||
static const int talkPushBigImage = 70;
|
||||
}
|
||||
|
||||
@ -4,6 +4,8 @@ import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||
import 'package:star_lock/tools/push/message_constant.dart';
|
||||
import 'package:star_lock/tools/push/notification_service.dart';
|
||||
import 'package:star_lock/tools/push/xs_jPhush.dart';
|
||||
|
||||
class MessageManagement {
|
||||
//分析消息数据
|
||||
@ -105,6 +107,10 @@ class MessageManagement {
|
||||
// }
|
||||
eventBus.fire(RefreshLockInfoDataEvent(keyId: keyId, lockId: lockId));
|
||||
break;
|
||||
case MessageConstant.talkPushBigImage:
|
||||
// XSJPushProvider().showCustomNotification(data);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw Exception('无法识别eventNo 参数:$eventNo');
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ class NotificationService {
|
||||
NotificationDetails(android: androidPlatformChannelSpecifics);
|
||||
|
||||
await _flutterLocalNotificationsPlugin.show(
|
||||
0,
|
||||
1,
|
||||
title,
|
||||
body,
|
||||
platformChannelSpecifics,
|
||||
@ -52,7 +52,7 @@ class NotificationService {
|
||||
// //读取网络下载图片
|
||||
// final ByteArrayAndroidBitmap? bigPicture = await _downloadImage(imageUrl);
|
||||
// 读取本地图片
|
||||
final ByteData imageData = await rootBundle.load('images/call_me_icon.jpg');
|
||||
final ByteData imageData = await rootBundle.load('images/call_me_icon.png');
|
||||
final Uint8List imageBytes = imageData.buffer.asUint8List();
|
||||
final ByteArrayAndroidBitmap bigPicture =
|
||||
ByteArrayAndroidBitmap(imageBytes);
|
||||
@ -76,15 +76,14 @@ class NotificationService {
|
||||
importance: Importance.max,
|
||||
priority: Priority.high,
|
||||
styleInformation: bigPictureStyleInformation,
|
||||
sound: const RawResourceAndroidNotificationSound(
|
||||
'assets/ring1.mp3'), // 自定义铃声
|
||||
sound: const RawResourceAndroidNotificationSound('ring_wx'), // 自定义铃声
|
||||
);
|
||||
|
||||
final NotificationDetails platformChannelSpecifics =
|
||||
NotificationDetails(android: androidPlatformChannelSpecifics);
|
||||
|
||||
await _flutterLocalNotificationsPlugin.show(
|
||||
0,
|
||||
1,
|
||||
title,
|
||||
body,
|
||||
platformChannelSpecifics,
|
||||
@ -104,4 +103,9 @@ class NotificationService {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// 取消所有本地通知
|
||||
Future<void> cancelAllNotifications() async {
|
||||
await _flutterLocalNotificationsPlugin.cancelAll();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,13 +1,9 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_local_notifications/flutter_local_notifications.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';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/NativeInteractionTool.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/push/message_management.dart';
|
||||
import 'package:star_lock/tools/push/notification_service.dart';
|
||||
@ -27,7 +23,7 @@ class XSJPushProvider {
|
||||
return;
|
||||
}
|
||||
|
||||
print('jPushKey ${F.jPushKey}');
|
||||
AppLog.log('jPushKey ${F.jPushKey}');
|
||||
// final String? bundleIdentifier =
|
||||
// await NativeInteractionTool().getBundleIdentifier();
|
||||
// print('bundleIdentifier: $bundleIdentifier');
|
||||
@ -46,7 +42,7 @@ class XSJPushProvider {
|
||||
AppLog.log('JPush initialized.');
|
||||
|
||||
final String rid = await jpush.getRegistrationID();
|
||||
print('flutter get registration id : $rid');
|
||||
AppLog.log('flutter get registration id : $rid');
|
||||
pushBindDeviceID(rid);
|
||||
}
|
||||
|
||||
@ -55,8 +51,7 @@ class XSJPushProvider {
|
||||
jpush.addEventHandler(
|
||||
onReceiveNotification: (Map<String, dynamic> message) async {
|
||||
AppLog.log('onReceiveNotification: $message');
|
||||
// 这里可以用 flutter_local_notifications 自定义通知样式
|
||||
showCustomNotification(message);
|
||||
// showCustomNotification(message);
|
||||
},
|
||||
onOpenNotification: (Map<String, dynamic> message) async {
|
||||
AppLog.log('onOpenNotification: $message');
|
||||
@ -86,16 +81,6 @@ class XSJPushProvider {
|
||||
// Remove the incorrect addEventHandler call
|
||||
}
|
||||
|
||||
Future<void> showCustomNotification(Map<String, dynamic> message) async {
|
||||
final String title = message['notification']['android']['title'] ?? '默认标题';
|
||||
final String content =
|
||||
message['notification']['android']['alert'] ?? '默认内容';
|
||||
final String imageUrl = message['notification']['android']['extras']
|
||||
?['image_url']; // 从 extras 获取图片
|
||||
|
||||
NotificationService().showImageNotification(title, content, imageUrl);
|
||||
}
|
||||
|
||||
Future<void> pushBindDeviceID(String deviceID) async {
|
||||
try {
|
||||
if (deviceID.isEmpty) {
|
||||
@ -118,22 +103,12 @@ class XSJPushProvider {
|
||||
}
|
||||
}
|
||||
|
||||
//本地通知初始化 isCancelLocalPush 是否取消所有本地通知
|
||||
Future<void> initLocalNotification({required bool isCancelLocalPush}) async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
|
||||
FlutterLocalNotificationsPlugin();
|
||||
void showCustomNotification(Map<String, dynamic> data) {
|
||||
final String title = data['notification']['android']['title'] ?? '默认标题';
|
||||
final String content = data['notification']['android']['alert'] ?? '默认内容';
|
||||
final String imageUrl = data['notification']['android']['extras']
|
||||
?['image_url']; // 从 extras 获取图片
|
||||
|
||||
if (Platform.isAndroid) {
|
||||
const AndroidInitializationSettings initializationSettingsAndroid =
|
||||
AndroidInitializationSettings('app_icon');
|
||||
const InitializationSettings initializationSettings =
|
||||
InitializationSettings(android: initializationSettingsAndroid);
|
||||
await flutterLocalNotificationsPlugin.initialize(initializationSettings);
|
||||
}
|
||||
|
||||
if (isCancelLocalPush) {
|
||||
await flutterLocalNotificationsPlugin.cancelAll();
|
||||
}
|
||||
NotificationService().showImageNotification(title, content, imageUrl);
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,22 +27,23 @@ else
|
||||
fi
|
||||
echo "compare_json:$compare_json\n"
|
||||
new_patch=$patch
|
||||
new_minor=$minor
|
||||
while IFS= read -r commit_json; do
|
||||
# 使用 jq 解析每一行的 JSON 对象
|
||||
commit_id=$(echo "$commit_json" | jq -r '.id')
|
||||
commit_message=$(echo "$commit_json" | jq -r '.message')
|
||||
echo "----$commit_message"
|
||||
if [[ "$commit_message" =~ ("feat:"*) ]]; then
|
||||
((minor++))
|
||||
new_patch=0
|
||||
break
|
||||
elif [[ "$commit_message" =~ ("fix:"*) ]] && [[ $new_patch == $patch ]]; then
|
||||
if [[ "$commit_message" =~ ("feat:"*) ]] && [[ $new_minor == $minor ]]; then
|
||||
((new_minor++))
|
||||
# new_patch=0
|
||||
# break
|
||||
elif [[ "$commit_message" =~ ("fix:"*) ]]; then
|
||||
((new_patch++))
|
||||
elif [[ ! "$commit_message" =~ ("Merge"* | "Revert"*) ]] && [[ $new_patch == $patch ]]; then
|
||||
elif [[ ! "$commit_message" =~ ("Merge"* | "Revert"*) ]]; then
|
||||
((new_patch++))
|
||||
fi
|
||||
done < <(echo "$compare_json" | jq -c '.commits[] | {id: .id, message: .message}')
|
||||
next_tag="v$major.$minor.$new_patch"
|
||||
next_tag="v$major.$new_minor.$new_patch"
|
||||
fi
|
||||
echo "New Tag:$newest_tag;New version: $next_tag;command: $1"
|
||||
if [[ "$1" == "generate_tag" ]];then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user