From 3fab87a3d04dd91827d85142ce86ada764a0448c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Irland?= Date: Thu, 11 Jan 2024 10:57:56 -0300 Subject: [PATCH] Fix handle open PN issue --- ios/Classes/SwiftFacebookAppEventsPlugin.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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) }