update
This commit is contained in:
Binary file not shown.
@@ -2636,8 +2636,8 @@
|
||||
filePath = "OrderSchedulingNotificationService/NotificationService.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "47"
|
||||
endingLineNumber = "47"
|
||||
startingLineNumber = "57"
|
||||
endingLineNumber = "57"
|
||||
landmarkName = "didReceive(_:withContentHandler:)"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
@@ -3004,5 +3004,132 @@
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
uuid = "8F63E486-6C7E-43D3-B7DC-0EC3E28F533D"
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "OrderSchedulingNotificationService/NotificationService.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "24"
|
||||
endingLineNumber = "24"
|
||||
landmarkName = "didReceive(_:withContentHandler:)"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
uuid = "ED9EFA7A-7FCA-4E48-822A-321E00CD9178"
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "OrderScheduling/Global/GroupData/GroupData.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "22"
|
||||
endingLineNumber = "22"
|
||||
landmarkName = "parserAlertToDictionary(userInfo:)"
|
||||
landmarkType = "7">
|
||||
<Locations>
|
||||
<Location
|
||||
uuid = "ED9EFA7A-7FCA-4E48-822A-321E00CD9178 - c4488d2259840bec"
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
symbolName = "OrderScheduling.GroupData.parserAlertToString(userInfo: Swift.Optional<Swift.Dictionary<Swift.AnyHashable, Any>>) -> Swift.Optional<Swift.String>"
|
||||
moduleName = "OrderScheduling"
|
||||
usesParentBreakpointCondition = "Yes"
|
||||
urlString = "file:///Users/zd/Desktop/%E4%B8%AD%E9%81%93%E6%95%91%E6%8F%B4/OrderScheduling/OrderScheduling/Global/GroupData/GroupData.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "24"
|
||||
endingLineNumber = "24"
|
||||
offsetFromSymbolStart = "97">
|
||||
</Location>
|
||||
<Location
|
||||
uuid = "ED9EFA7A-7FCA-4E48-822A-321E00CD9178 - 7671f3e233c182e2"
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
symbolName = "OrderSchedulingNotificationService.GroupData.parserAlertToDictionary(userInfo: Swift.Optional<Swift.Dictionary<Swift.AnyHashable, Any>>) -> Swift.Optional<Swift.Dictionary<Swift.String, Swift.String>>"
|
||||
moduleName = "OrderSchedulingNotificationService"
|
||||
usesParentBreakpointCondition = "Yes"
|
||||
urlString = "file:///Users/zd/Desktop/%E4%B8%AD%E9%81%93%E6%95%91%E6%8F%B4/OrderScheduling/OrderScheduling/Global/GroupData/GroupData.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "22"
|
||||
endingLineNumber = "22"
|
||||
offsetFromSymbolStart = "1376">
|
||||
</Location>
|
||||
</Locations>
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
uuid = "1274D9D9-A9D2-4F3F-883A-A8FB6AAFB6E9"
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "OrderScheduling/Global/GroupData/GroupData.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "25"
|
||||
endingLineNumber = "25"
|
||||
landmarkName = "parserAlertToDictionary(userInfo:)"
|
||||
landmarkType = "7">
|
||||
<Locations>
|
||||
<Location
|
||||
uuid = "1274D9D9-A9D2-4F3F-883A-A8FB6AAFB6E9 - c4488d2259840bcd"
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
symbolName = "OrderScheduling.GroupData.parserAlertToString(userInfo: Swift.Optional<Swift.Dictionary<Swift.AnyHashable, Any>>) -> Swift.Optional<Swift.String>"
|
||||
moduleName = "OrderScheduling"
|
||||
usesParentBreakpointCondition = "Yes"
|
||||
urlString = "file:///Users/zd/Desktop/%E4%B8%AD%E9%81%93%E6%95%91%E6%8F%B4/OrderScheduling/OrderScheduling/Global/GroupData/GroupData.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "25"
|
||||
endingLineNumber = "25"
|
||||
offsetFromSymbolStart = "473">
|
||||
</Location>
|
||||
<Location
|
||||
uuid = "1274D9D9-A9D2-4F3F-883A-A8FB6AAFB6E9 - c4488d2259840bcd"
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
symbolName = "OrderScheduling.GroupData.parserAlertToString(userInfo: Swift.Optional<Swift.Dictionary<Swift.AnyHashable, Any>>) -> Swift.Optional<Swift.String>"
|
||||
moduleName = "OrderScheduling"
|
||||
usesParentBreakpointCondition = "Yes"
|
||||
urlString = "file:///Users/zd/Desktop/%E4%B8%AD%E9%81%93%E6%95%91%E6%8F%B4/OrderScheduling/OrderScheduling/Global/GroupData/GroupData.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "25"
|
||||
endingLineNumber = "25"
|
||||
offsetFromSymbolStart = "662">
|
||||
</Location>
|
||||
<Location
|
||||
uuid = "1274D9D9-A9D2-4F3F-883A-A8FB6AAFB6E9 - 7671f3e233c1828d"
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
symbolName = "OrderSchedulingNotificationService.GroupData.parserAlertToDictionary(userInfo: Swift.Optional<Swift.Dictionary<Swift.AnyHashable, Any>>) -> Swift.Optional<Swift.Dictionary<Swift.String, Swift.String>>"
|
||||
moduleName = "OrderSchedulingNotificationService"
|
||||
usesParentBreakpointCondition = "Yes"
|
||||
urlString = "file:///Users/zd/Desktop/%E4%B8%AD%E9%81%93%E6%95%91%E6%8F%B4/OrderScheduling/OrderScheduling/Global/GroupData/GroupData.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "25"
|
||||
endingLineNumber = "25"
|
||||
offsetFromSymbolStart = "1508">
|
||||
</Location>
|
||||
</Locations>
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
</Breakpoints>
|
||||
</Bucket>
|
||||
|
||||
BIN
OrderScheduling/.DS_Store
vendored
BIN
OrderScheduling/.DS_Store
vendored
Binary file not shown.
@@ -13,10 +13,31 @@ open class GroupData {
|
||||
public static let `default` = GroupData()
|
||||
let groudUserDefault = UserDefaults(suiteName: GROUPID)
|
||||
|
||||
// 判断推送能不能解析出字典
|
||||
func parserAlertToDictionary(userInfo:[AnyHashable:Any]?) -> Dictionary<String,String>? {
|
||||
let aps = userInfo?[pushNoti_aps_key] as? [String:Any]
|
||||
|
||||
if let data = (aps?[pushNoti_alert_key] as? String)?.data(using: .utf8) {
|
||||
let dict = try? JSONSerialization.jsonObject(with: data, options: []) as? [String: String]
|
||||
return dict
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func parserAlertToString(userInfo:[AnyHashable:Any]?) -> String? {
|
||||
let aps = userInfo?[pushNoti_aps_key] as? [String:Any]
|
||||
let string = aps?[pushNoti_alert_key] as? String
|
||||
return string
|
||||
}
|
||||
|
||||
// 判断新推送是不是新订单
|
||||
func isOrderPushNotification(userInfo:[AnyHashable:Any]?) -> Bool {
|
||||
if let userInfo {
|
||||
if let aps = userInfo[pushNoti_aps_key] as? [String:Any], let dict = (aps[pushNoti_alert_key] as? Dictionary<String, Any>), (dict[pushNoti_title_key] as? String) == pushNoti_newOrder_key {
|
||||
if let dict = parserAlertToDictionary(userInfo: userInfo), dict[pushNoti_title_key] == pushNoti_newOrder_key {
|
||||
return true
|
||||
}
|
||||
if let string = parserAlertToString(userInfo: userInfo), string.contains(pushNoti_newOrder_key) == true {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,19 @@ class NotificationService: UNNotificationServiceExtension {
|
||||
|
||||
if let bestAttemptContent = bestAttemptContent {
|
||||
// Modify the notification content here...
|
||||
// bestAttemptContent.title = "\(bestAttemptContent.title) [modified]"
|
||||
let userInfo = bestAttemptContent.userInfo
|
||||
|
||||
if let dict = GROUP.parserAlertToDictionary(userInfo: userInfo) {
|
||||
if let title = dict[pushNoti_title_key] {
|
||||
bestAttemptContent.title = title
|
||||
}
|
||||
if let body = dict[pushNoti_body_key] {
|
||||
bestAttemptContent.body = body
|
||||
}
|
||||
}else if let body = GROUP.parserAlertToString(userInfo: userInfo) {
|
||||
bestAttemptContent.body = body
|
||||
}
|
||||
|
||||
// 只有订单类型才写入group,因为需要弹窗和声音
|
||||
if GROUP.isOrderPushNotification(userInfo: userInfo) == true {
|
||||
var sound : UNNotificationSound?
|
||||
|
||||
BIN
Pods/.DS_Store
generated
vendored
BIN
Pods/.DS_Store
generated
vendored
Binary file not shown.
BIN
Pods/AMapNavi-NO-IDFA/.DS_Store
generated
vendored
Normal file
BIN
Pods/AMapNavi-NO-IDFA/.DS_Store
generated
vendored
Normal file
Binary file not shown.
BIN
Pods/AMapNavi-NO-IDFA/AMapNaviKit.framework/.DS_Store
generated
vendored
BIN
Pods/AMapNavi-NO-IDFA/AMapNaviKit.framework/.DS_Store
generated
vendored
Binary file not shown.
BIN
Pods/JCore/.DS_Store
generated
vendored
Normal file
BIN
Pods/JCore/.DS_Store
generated
vendored
Normal file
Binary file not shown.
BIN
Pods/JPush/.DS_Store
generated
vendored
Normal file
BIN
Pods/JPush/.DS_Store
generated
vendored
Normal file
Binary file not shown.
Reference in New Issue
Block a user