推送超时处理
This commit is contained in:
Binary file not shown.
@@ -81,6 +81,8 @@ class NotificationService: UNNotificationServiceExtension {
|
|||||||
if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent {
|
if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent {
|
||||||
let userInfo = bestAttemptContent.userInfo
|
let userInfo = bestAttemptContent.userInfo
|
||||||
|
|
||||||
|
let userInfo = bestAttemptContent.userInfo
|
||||||
|
|
||||||
if let dict = GROUP.parserAlertToDictionary(userInfo: userInfo) {
|
if let dict = GROUP.parserAlertToDictionary(userInfo: userInfo) {
|
||||||
if let title = dict[pushNoti_title_key] {
|
if let title = dict[pushNoti_title_key] {
|
||||||
bestAttemptContent.title = title
|
bestAttemptContent.title = title
|
||||||
@@ -92,9 +94,42 @@ class NotificationService: UNNotificationServiceExtension {
|
|||||||
bestAttemptContent.body = body
|
bestAttemptContent.body = body
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 订单类型写入
|
||||||
|
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
|
bestAttemptContent.sound = .default
|
||||||
contentHandler(bestAttemptContent)
|
contentHandler(bestAttemptContent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,17 +5,17 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<testcase classname="fastlane.lanes" name="0: default_platform" time="0.000163">
|
<testcase classname="fastlane.lanes" name="0: default_platform" time="0.000169">
|
||||||
|
|
||||||
</testcase>
|
</testcase>
|
||||||
|
|
||||||
|
|
||||||
<testcase classname="fastlane.lanes" name="1: gym" time="70.566416">
|
<testcase classname="fastlane.lanes" name="1: gym" time="82.302067">
|
||||||
|
|
||||||
</testcase>
|
</testcase>
|
||||||
|
|
||||||
|
|
||||||
<testcase classname="fastlane.lanes" name="2: pgyer" time="15.253876">
|
<testcase classname="fastlane.lanes" name="2: pgyer" time="10.923831">
|
||||||
|
|
||||||
</testcase>
|
</testcase>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user