@@ -182,19 +182,17 @@ func getFlutterError(_ error: Error) -> FlutterError {
182
182
public func application( _ application: UIApplication , didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data ) {
183
183
channel. invokeMethod ( " onToken " , arguments: deviceToken. hexString)
184
184
}
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
198
196
}
199
197
200
198
public func userNotificationCenter( _ center: UNUserNotificationCenter , willPresent notification: UNNotification , withCompletionHandler completionHandler: @escaping ( UNNotificationPresentationOptions ) -> Void ) {
@@ -212,8 +210,8 @@ func getFlutterError(_ error: Error) -> FlutterError {
212
210
completionHandler ( [ . alert, . sound] )
213
211
} else {
214
212
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 )
217
215
}
218
216
}
219
217
}
@@ -232,13 +230,9 @@ func getFlutterError(_ error: Error) -> FlutterError {
232
230
return
233
231
}
234
232
235
- onResume ( userInfo : dict)
233
+ channel . invokeMethod ( " onResume " , arguments : dict)
236
234
completionHandler ( )
237
235
}
238
-
239
- func onResume( userInfo: [ AnyHashable : Any ] ) {
240
- channel. invokeMethod ( " onResume " , arguments: userInfo)
241
- }
242
236
}
243
237
244
238
extension UNNotificationCategoryOptions {
0 commit comments