@@ -97,23 +97,6 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
9797 ) {
9898 let userInfo = notification. request. content. userInfo
9999 Log . d ( tag, " Notification received via userNotificationCenter(willPresent) " , userInfo)
100-
101- guard let message = Message . from ( userInfo: userInfo) else {
102- Log . w ( tag, " Cannot convert userInfo to message " , userInfo)
103- completionHandler ( [ ] )
104- return
105- }
106-
107- let store = Store . shared
108- let baseUrl = userInfo [ " base_url " ] as? String ?? Config . appBaseUrl
109-
110- guard let subscription = store. getSubscription ( baseUrl: baseUrl, topic: message. topic) else {
111- Log . w ( tag, " Subscription \( topicUrl ( baseUrl: baseUrl, topic: message. topic) ) unknown " )
112- completionHandler ( [ ] )
113- return
114- }
115- Store . shared. save ( notificationFromMessage: message, withSubscription: subscription)
116-
117100 completionHandler ( [ [ . banner, . sound] ] )
118101 }
119102
@@ -131,17 +114,9 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
131114 return
132115 }
133116
134- let store = Store . shared
135117 let baseUrl = userInfo [ " base_url " ] as? String ?? Config . appBaseUrl
136118 let action = message. actions? . first { $0. id == response. actionIdentifier }
137119
138- guard let subscription = store. getSubscription ( baseUrl: baseUrl, topic: message. topic) else {
139- Log . w ( tag, " Subscription \( topicUrl ( baseUrl: baseUrl, topic: message. topic) ) unknown " )
140- completionHandler ( )
141- return
142- }
143- Store . shared. save ( notificationFromMessage: message, withSubscription: subscription)
144-
145120 // Show current topic
146121 if message. topic != " " {
147122 selectedBaseUrl = topicUrl ( baseUrl: baseUrl, topic: message. topic)
0 commit comments