diff --git a/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/UserInterfaceState.xcuserstate b/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/UserInterfaceState.xcuserstate index 0c2e1a2..510c105 100644 Binary files a/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/UserInterfaceState.xcuserstate and b/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/OrderSchedulingNotificationService/NotificationService.swift b/OrderSchedulingNotificationService/NotificationService.swift index dcf0252..5504b90 100644 --- a/OrderSchedulingNotificationService/NotificationService.swift +++ b/OrderSchedulingNotificationService/NotificationService.swift @@ -81,6 +81,8 @@ class NotificationService: UNNotificationServiceExtension { if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent { let userInfo = bestAttemptContent.userInfo + let userInfo = bestAttemptContent.userInfo + if let dict = GROUP.parserAlertToDictionary(userInfo: userInfo) { if let title = dict[pushNoti_title_key] { bestAttemptContent.title = title @@ -92,8 +94,41 @@ class NotificationService: UNNotificationServiceExtension { bestAttemptContent.body = body } - bestAttemptContent.sound = .default - contentHandler(bestAttemptContent) + // 订单类型写入 + if GROUP.isOrderPushNotification(userInfo: userInfo) == true { + var sound : UNNotificationSound? + + let juheVehcileName = userInfo[pushNoti_juheVehcileName_key] as? String + if juheVehcileName?.isEmpty == false { + sound = UNNotificationSound(named: UNNotificationSoundName(rawValue: juheNewOrderAudio_key)) + }else{ + sound = UNNotificationSound(named: UNNotificationSoundName(rawValue: newOrderAudio_key)) + } + + bestAttemptContent.sound = sound + + GROUP.setBestAttemptContentUserInfo(bestAttemptContentUserInfo: userInfo) + contentHandler(bestAttemptContent) + }else{ + // 当group中没有订单类型的数据时才写入 + if let isShowPop = (userInfo[pushNoti_broadcastKeywords_key] as? Bool), isShowPop == true { + if let userInfo = GROUP.bestAttemptContentUserInfo,GROUP.isOrderPushNotification(userInfo: userInfo) == true { + }else{ + GROUP.setBestAttemptContentUserInfo(bestAttemptContentUserInfo: userInfo) + } + } + // 语音播报能力不具备,只播放默认声音 + if GROUP.isAppointmentPushNotification(userInfo: userInfo) == true { + bestAttemptContent.sound = UNNotificationSound(named: UNNotificationSoundName(rawValue: appointmentOrderAudio_key)) + contentHandler(bestAttemptContent) + }else if let broadcastKeywords = (userInfo[pushNoti_broadcastKeywords_key] as? String),broadcastKeywords.isEmpty == false { + bestAttemptContent.sound = .default + contentHandler(bestAttemptContent) + }else{ + bestAttemptContent.sound = .default + contentHandler(bestAttemptContent) + } + } } } diff --git a/fastlane/report.xml b/fastlane/report.xml index 5ada8aa..2b2e314 100644 --- a/fastlane/report.xml +++ b/fastlane/report.xml @@ -5,17 +5,17 @@ - + - + - +