update
This commit is contained in:
@@ -44,6 +44,19 @@ open class GroupData {
|
||||
return false
|
||||
}
|
||||
|
||||
// 判断新推送是不是预约订单
|
||||
func isAppointmentPushNotification(userInfo:[AnyHashable:Any]?) -> Bool {
|
||||
if let userInfo {
|
||||
if let dict = parserAlertToDictionary(userInfo: userInfo), dict[pushNoti_title_key] == pushNoti_appointmentOrder_key {
|
||||
return true
|
||||
}
|
||||
if let string = parserAlertToString(userInfo: userInfo), string.contains(pushNoti_appointmentOrder_key) == true {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// 解析需要播放的文字
|
||||
func parserBroadcastToString(userInfo:[AnyHashable:Any]?) -> String? {
|
||||
if let broadcastKeywords = (userInfo?[pushNoti_broadcastKeywords_key] as? String),broadcastKeywords.isEmpty == false {
|
||||
@@ -86,17 +99,17 @@ open class GroupData {
|
||||
groudUserDefault?.set(newMessageSound, forKey: newMessageSound_key)
|
||||
}
|
||||
|
||||
// 不需要记录
|
||||
public var newMessageAlert : Bool {
|
||||
return (groudUserDefault?.object(forKey: newMessageAlert_key) as? Bool) ?? true
|
||||
}
|
||||
|
||||
func setNewMessageAlert(newMessageAlert:Bool?) {
|
||||
groudUserDefault?.set(newMessageAlert, forKey: newMessageAlert_key)
|
||||
}
|
||||
// // 不需要记录
|
||||
// public var newMessageAlert : Bool {
|
||||
// return (groudUserDefault?.object(forKey: newMessageAlert_key) as? Bool) ?? true
|
||||
// }
|
||||
//
|
||||
// func setNewMessageAlert(newMessageAlert:Bool?) {
|
||||
// groudUserDefault?.set(newMessageAlert, forKey: newMessageAlert_key)
|
||||
// }
|
||||
|
||||
func clear() {
|
||||
GROUP.setNewMessageAlert(newMessageAlert: nil)
|
||||
// GROUP.setNewMessageAlert(newMessageAlert: nil)
|
||||
GROUP.setNewMessageSound(newMessageSound: nil)
|
||||
GROUP.setBestAttemptContentUserInfo(bestAttemptContentUserInfo: nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user