推送修改

This commit is contained in:
ddisfriend
2025-06-25 17:05:05 +08:00
parent f0519625f7
commit 3ecb0be526
2 changed files with 12 additions and 15 deletions

View File

@@ -34,7 +34,7 @@ open class GroupData {
// //
func isOrderPushNotification(userInfo:[AnyHashable:Any]?) -> Bool { func isOrderPushNotification(userInfo:[AnyHashable:Any]?) -> Bool {
if let userInfo { if let userInfo {
if let dict = parserAlertToDictionary(userInfo: userInfo), dict[pushNoti_pushType_key] == "1" { if let pushType = (userInfo[pushNoti_pushType_key] as? String), pushType == "1" {
return true return true
} }
} }
@@ -44,7 +44,7 @@ open class GroupData {
// //
func isCancelOrderPushNotification(userInfo:[AnyHashable:Any]?) -> Bool { func isCancelOrderPushNotification(userInfo:[AnyHashable:Any]?) -> Bool {
if let userInfo { if let userInfo {
if let dict = parserAlertToDictionary(userInfo: userInfo), dict[pushNoti_pushType_key] == "8" { if let pushType = (userInfo[pushNoti_pushType_key] as? String), pushType == "8" {
return true return true
} }
} }
@@ -54,7 +54,7 @@ open class GroupData {
// //
func isReportIndexPushNotification(userInfo:[AnyHashable:Any]?) -> Bool { func isReportIndexPushNotification(userInfo:[AnyHashable:Any]?) -> Bool {
if let userInfo { if let userInfo {
if let dict = parserAlertToDictionary(userInfo: userInfo), dict[pushNoti_pushType_key] == "10" { if let pushType = (userInfo[pushNoti_pushType_key] as? String), pushType == "10" {
return true return true
} }
} }
@@ -82,9 +82,6 @@ open class GroupData {
if let isShowPop = (userInfo?[pushNoti_isShowPop_key] as? Bool),isShowPop == true { if let isShowPop = (userInfo?[pushNoti_isShowPop_key] as? Bool),isShowPop == true {
return true return true
} }
if let isShowPop = (userInfo?[pushNoti_isShowPop_key] as? String),isShowPop == "true" {
return true
}
return false return false
} }

View File

@@ -27,15 +27,15 @@ open class PushNotiCommonTool : NSObject {
if let body = dict[pushNoti_body_key] { if let body = dict[pushNoti_body_key] {
commonView.contentLabel.text = body commonView.contentLabel.text = body
} }
if let _userOrderId = dict[pushNoti_userOrderId_key] { }
userOrderId = Int(_userOrderId) if let _userOrderId = (userInfo?[pushNoti_userOrderId_key] as? Int) {
} userOrderId = _userOrderId
if let _taskOrderId = dict[pushNoti_taskOrderId_key] { }
taskOrderId = Int(_taskOrderId) if let _taskOrderId = (userInfo?[pushNoti_taskOrderId_key] as? Int) {
} taskOrderId = _taskOrderId
if let _taskCode = dict[pushNoti_taskCode_key] { }
taskCode = _taskCode if let _taskCode = (userInfo?[pushNoti_taskCode_key] as? String) {
} taskCode = _taskCode
} }
if let cancel = (userInfo?[pushNoti_cancelButtonText_key] as? String) { if let cancel = (userInfo?[pushNoti_cancelButtonText_key] as? String) {
commonView.cancelButton.setTitle(cancel, for: .normal) commonView.cancelButton.setTitle(cancel, for: .normal)