@@ -182,19 +182,17 @@ func getFlutterError(_ error: Error) -> FlutterError {
182182 public func application( _ application: UIApplication , didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data ) {
183183 channel. invokeMethod ( " onToken " , arguments: deviceToken. hexString)
184184 }
185-
186-
187- public func application( _ application: UIApplication , didReceiveRemoteNotification userInfo: [ AnyHashable : Any ] , fetchCompletionHandler completionHandler: @escaping ( UIBackgroundFetchResult ) -> Void ) -> Bool {
188- let userInfo = FlutterApnsSerialization . remoteMessageUserInfo ( toDict: userInfo)
189-
190- if resumingFromBackground {
191- onResume ( userInfo: userInfo)
192- } else {
193- channel. invokeMethod ( " onMessage " , arguments: userInfo)
194- }
195-
196- completionHandler ( . noData)
197- return true
185+
186+ public func application( _ application: UIApplication , didReceiveRemoteNotification userInfo: [ AnyHashable : Any ] , fetchCompletionHandler completionHandler: @escaping ( UIBackgroundFetchResult ) -> Void ) -> Bool {
187+ let userInfo = FlutterApnsSerialization . remoteMessageUserInfo ( toDict: userInfo)
188+
189+ if resumingFromBackground {
190+ } else {
191+ channel. invokeMethod ( " onMessage " , arguments: userInfo)
192+ }
193+
194+ completionHandler ( . noData)
195+ return true
198196 }
199197
200198 public func userNotificationCenter( _ center: UNUserNotificationCenter , willPresent notification: UNNotification , withCompletionHandler completionHandler: @escaping ( UNNotificationPresentationOptions ) -> Void ) {
@@ -212,8 +210,8 @@ func getFlutterError(_ error: Error) -> FlutterError {
212210 completionHandler ( [ . alert, . sound] )
213211 } else {
214212 completionHandler ( [ ] )
215- let userInfo = FlutterApnsSerialization . remoteMessageUserInfo ( toDict: userInfo)
216- self . channel. invokeMethod ( " onMessage " , arguments: userInfo )
213+ let dict = FlutterApnsSerialization . remoteMessageUserInfo ( toDict: userInfo)
214+ self . channel. invokeMethod ( " onMessage " , arguments: dict )
217215 }
218216 }
219217 }
@@ -232,13 +230,9 @@ func getFlutterError(_ error: Error) -> FlutterError {
232230 return
233231 }
234232
235- onResume ( userInfo : dict)
233+ channel . invokeMethod ( " onResume " , arguments : dict)
236234 completionHandler ( )
237235 }
238-
239- func onResume( userInfo: [ AnyHashable : Any ] ) {
240- channel. invokeMethod ( " onResume " , arguments: userInfo)
241- }
242236}
243237
244238extension UNNotificationCategoryOptions {
0 commit comments