其他消息通知

This commit is contained in:
DDIsFriend
2023-08-31 10:20:19 +08:00
parent cce7060345
commit 3349aaa0cd
6 changed files with 69 additions and 63 deletions

View File

@@ -1252,7 +1252,7 @@
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent <BreakpointContent
uuid = "0AB5E12D-53CA-429C-8322-7C8342D48DEC" uuid = "0AB5E12D-53CA-429C-8322-7C8342D48DEC"
shouldBeEnabled = "Yes" shouldBeEnabled = "No"
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "OrderScheduling/Main/AppDelegate.swift" filePath = "OrderScheduling/Main/AppDelegate.swift"
@@ -1353,6 +1353,21 @@
endingLineNumber = "104" endingLineNumber = "104"
offsetFromSymbolStart = "317"> offsetFromSymbolStart = "317">
</Location> </Location>
<Location
uuid = "0AB5E12D-53CA-429C-8322-7C8342D48DEC - 80f31cf5eda3179c"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "OrderScheduling.AppDelegate.jpushNotificationCenter(_: __C.UNUserNotificationCenter, willPresent: __C.UNNotification, withCompletionHandler: (Swift.Int) -&gt; ()) -&gt; ()"
moduleName = "OrderScheduling"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/zd/Desktop/%E4%B8%AD%E9%81%93%E6%95%91%E6%8F%B4/OrderScheduling/OrderScheduling/Main/AppDelegate.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "104"
endingLineNumber = "104"
offsetFromSymbolStart = "288">
</Location>
</Locations> </Locations>
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
@@ -1366,8 +1381,8 @@
filePath = "OrderScheduling/Main/AppDelegate.swift" filePath = "OrderScheduling/Main/AppDelegate.swift"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "128" startingLineNumber = "133"
endingLineNumber = "128" endingLineNumber = "133"
landmarkName = "jpushNotificationAuthorization(_:withInfo:)" landmarkName = "jpushNotificationAuthorization(_:withInfo:)"
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
@@ -1382,8 +1397,8 @@
filePath = "OrderScheduling/Main/AppDelegate.swift" filePath = "OrderScheduling/Main/AppDelegate.swift"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "119" startingLineNumber = "124"
endingLineNumber = "119" endingLineNumber = "124"
landmarkName = "jpushNotificationCenter(_:didReceive:withCompletionHandler:)" landmarkName = "jpushNotificationCenter(_:didReceive:withCompletionHandler:)"
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
@@ -2033,8 +2048,8 @@
filePath = "OrderScheduling/Main/AppDelegate.swift" filePath = "OrderScheduling/Main/AppDelegate.swift"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "121" startingLineNumber = "126"
endingLineNumber = "121" endingLineNumber = "126"
landmarkName = "jpushNotificationCenter(_:didReceive:withCompletionHandler:)" landmarkName = "jpushNotificationCenter(_:didReceive:withCompletionHandler:)"
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
@@ -2636,8 +2651,8 @@
filePath = "OrderSchedulingNotificationService/NotificationService.swift" filePath = "OrderSchedulingNotificationService/NotificationService.swift"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "57" startingLineNumber = "59"
endingLineNumber = "57" endingLineNumber = "59"
landmarkName = "didReceive(_:withContentHandler:)" landmarkName = "didReceive(_:withContentHandler:)"
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
@@ -2765,54 +2780,6 @@
</Locations> </Locations>
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "A7C482B5-4E4D-4C20-807E-D7BF9E514DCC"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "OrderScheduling/Main/AppDelegate.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "108"
endingLineNumber = "108"
landmarkName = "jpushNotificationCenter(_:willPresent:withCompletionHandler:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "B1CE87FB-587E-47E0-A44F-029D609C17D5"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "OrderScheduling/Main/AppDelegate.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "109"
endingLineNumber = "109"
landmarkName = "jpushNotificationCenter(_:willPresent:withCompletionHandler:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "C8C55848-36F9-4558-9CBD-573B19F5959F"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "OrderScheduling/Main/AppDelegate.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "107"
endingLineNumber = "107"
landmarkName = "jpushNotificationCenter(_:willPresent:withCompletionHandler:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy <BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent <BreakpointContent
@@ -3131,5 +3098,37 @@
</Locations> </Locations>
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "9F8CE4E6-34BC-44BF-BFB0-51286E566A87"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "OrderScheduling/Main/AppDelegate.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "107"
endingLineNumber = "107"
landmarkName = "jpushNotificationCenter(_:willPresent:withCompletionHandler:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "553E1DED-598C-4AC7-AB8A-8E3A45E18CAD"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "OrderSchedulingNotificationService/NotificationService.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "53"
endingLineNumber = "53"
landmarkName = "didReceive(_:withContentHandler:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints> </Breakpoints>
</Bucket> </Bucket>

View File

@@ -155,7 +155,7 @@ open class Tool {
return string return string
} }
func dealAppExtension(completionHandler:(([AnyHashable:Any]) -> Void)?) { func dealWithOrderPushNotification(completionHandler:(([AnyHashable:Any]) -> Void)?) {
let userInfo = GROUP.bestAttemptContentUserInfo let userInfo = GROUP.bestAttemptContentUserInfo
if let userInfo { if let userInfo {
if completionHandler != nil { if completionHandler != nil {

View File

@@ -103,11 +103,16 @@ extension AppDelegate : JPUSHRegisterDelegate {
let userInfo = notification.request.content.userInfo let userInfo = notification.request.content.userInfo
if notification.request.trigger?.isKind(of: UNPushNotificationTrigger.self) == true { if notification.request.trigger?.isKind(of: UNPushNotificationTrigger.self) == true {
JPUSHService.handleRemoteNotification(userInfo) JPUSHService.handleRemoteNotification(userInfo)
if GROUP.isOrderPushNotification(userInfo: userInfo) == true {
// //
TOOL.dealAppExtension { userInfo in TOOL.dealWithOrderPushNotification { userInfo in
TOOL.playAlertWith(userInfo: userInfo) TOOL.playAlertWith(userInfo: userInfo)
TOOL.playVoiceWith(userInfo: userInfo) TOOL.playVoiceWith(userInfo: userInfo)
} }
}else{
completionHandler(1 << 1 | 1 << 2)
}
} }
completionHandler(0) completionHandler(0)
} }

View File

@@ -38,7 +38,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
JPUSHService.resetBadge() JPUSHService.resetBadge()
UIApplication.shared.applicationIconBadgeNumber = 0 UIApplication.shared.applicationIconBadgeNumber = 0
// //
TOOL.dealAppExtension { userInfo in TOOL.dealWithOrderPushNotification { userInfo in
TOOL.playAlertWith(userInfo: userInfo) TOOL.playAlertWith(userInfo: userInfo)
} }
} }

View File

@@ -46,6 +46,8 @@ class NotificationService: UNNotificationServiceExtension {
bestAttemptContent.sound = sound bestAttemptContent.sound = sound
GROUP.setBestAttemptContentUserInfo(bestAttemptContentUserInfo: userInfo) GROUP.setBestAttemptContentUserInfo(bestAttemptContentUserInfo: userInfo)
}else{
bestAttemptContent.sound = .default
} }
JPushNotificationExtensionService.jpushSetAppkey(JPushKey) JPushNotificationExtensionService.jpushSetAppkey(JPushKey)