diff --git a/ios/Classes/SwiftFacebookAppEventsPlugin.swift b/ios/Classes/SwiftFacebookAppEventsPlugin.swift index 9e9502ed..99e7b51a 100644 --- a/ios/Classes/SwiftFacebookAppEventsPlugin.swift +++ b/ios/Classes/SwiftFacebookAppEventsPlugin.swift @@ -140,13 +140,11 @@ public class SwiftFacebookAppEventsPlugin: NSObject, FlutterPlugin { private func handlePushNotificationOpen(_ call: FlutterMethodCall, result: @escaping FlutterResult) { let arguments = call.arguments as? [String: Any] ?? [String: Any]() let payload = arguments["payload"] as? [String: Any] - if let action = arguments["action"] { - let actionString = action as! String - AppEvents.shared.logPushNotificationOpen(payload: payload!, action: actionString) + if let action = arguments["action"] as? String { + AppEvents.shared.logPushNotificationOpen(payload: payload!, action: action) } else { AppEvents.shared.logPushNotificationOpen(payload: payload!) } - result(nil) }