@@ -183,20 +183,6 @@ func getFlutterError(_ error: Error) -> FlutterError {
183183 channel. invokeMethod ( " onToken " , arguments: deviceToken. hexString)
184184 }
185185
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
198- }
199-
200186 public func userNotificationCenter( _ center: UNUserNotificationCenter , willPresent notification: UNNotification , withCompletionHandler completionHandler: @escaping ( UNNotificationPresentationOptions ) -> Void ) {
201187 let userInfo = notification. request. content. userInfo
202188
@@ -212,8 +198,8 @@ func getFlutterError(_ error: Error) -> FlutterError {
212198 completionHandler ( [ . alert, . sound] )
213199 } else {
214200 completionHandler ( [ ] )
215- let userInfo = FlutterApnsSerialization . remoteMessageUserInfo ( toDict: userInfo)
216- self . channel. invokeMethod ( " onMessage " , arguments: userInfo )
201+ let dict = FlutterApnsSerialization . remoteMessageUserInfo ( toDict: userInfo)
202+ self . channel. invokeMethod ( " onMessage " , arguments: dict )
217203 }
218204 }
219205 }
@@ -232,13 +218,9 @@ func getFlutterError(_ error: Error) -> FlutterError {
232218 return
233219 }
234220
235- onResume ( userInfo : dict)
221+ channel . invokeMethod ( " onResume " , arguments : dict)
236222 completionHandler ( )
237223 }
238-
239- func onResume( userInfo: [ AnyHashable : Any ] ) {
240- channel. invokeMethod ( " onResume " , arguments: userInfo)
241- }
242224}
243225
244226extension UNNotificationCategoryOptions {
0 commit comments