update
This commit is contained in:
@@ -21,21 +21,25 @@ class NotificationService: UNNotificationServiceExtension {
|
||||
// Modify the notification content here...
|
||||
// bestAttemptContent.title = "\(bestAttemptContent.title) [modified]"
|
||||
let userInfo = bestAttemptContent.userInfo
|
||||
|
||||
let aps = userInfo["aps"] as? [String:Any]
|
||||
if let aps, (aps["alert"] as? String) == "新订单" {
|
||||
let juheVehcileName = userInfo["juheVehcileName"] as? String
|
||||
|
||||
// 只有订单类型才写入group,因为需要弹窗和声音
|
||||
let aps = userInfo[aps_key] as? [String:Any]
|
||||
if let aps, (aps[alert_key] as? String) == "新订单" {
|
||||
var sound : UNNotificationSound?
|
||||
|
||||
let juheVehcileName = userInfo[juheVehcileName_key] as? String
|
||||
if juheVehcileName?.isEmpty == false {
|
||||
bestAttemptContent.sound = UNNotificationSound(named: UNNotificationSoundName(rawValue: "juheNewOrderAudio.wav"))
|
||||
sound = UNNotificationSound(named: UNNotificationSoundName(rawValue: juheNewOrderAudio_key))
|
||||
}else{
|
||||
bestAttemptContent.sound = UNNotificationSound(named: UNNotificationSoundName(rawValue: "newOrderAudio.wav"))
|
||||
sound = UNNotificationSound(named: UNNotificationSoundName(rawValue: newOrderAudio_key))
|
||||
}
|
||||
|
||||
bestAttemptContent.sound = sound
|
||||
|
||||
GROUP.setBestAttemptContentUserInfo(bestAttemptContentUserInfo: userInfo)
|
||||
}
|
||||
|
||||
let userDefault = UserDefaults.init(suiteName: "group.com.sino.supplier")
|
||||
userDefault?.setValue(userInfo, forKey: "bestAttemptContentUserInfo_key")
|
||||
|
||||
JPushNotificationExtensionService.jpushSetAppkey("259b546bb2aaf5f02ffa2547")
|
||||
JPushNotificationExtensionService.jpushSetAppkey(JPushKey)
|
||||
JPushNotificationExtensionService.jpushReceive(request) {
|
||||
contentHandler(request.content)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user