TF-2384 Handle open email detailed when click notification on terminated mode

Signed-off-by: dab246 <tdvu@linagora.com>
(cherry picked from commit d59ed90fa89755f476150eaee7527282ef0bae7a)
This commit is contained in:
dab246
2023-12-25 12:21:55 +07:00
committed by Dat H. Pham
parent 84b7239ad0
commit ff3af007e0
3 changed files with 45 additions and 3 deletions
+12
View File
@@ -8,6 +8,7 @@ import flutter_local_notifications
@objc class AppDelegate: FlutterAppDelegate {
var notificationInteractionChannel: FlutterMethodChannel?
var initialNotificationInfo: Any?
override func application(
_ application: UIApplication,
@@ -16,6 +17,7 @@ import flutter_local_notifications
GeneratedPluginRegistrant.register(with: self)
createNotificationInteractionChannel()
initialNotificationInfo = launchOptions?[.remoteNotification]
if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate
@@ -142,5 +144,15 @@ extension AppDelegate {
name: "notification_interaction_channel",
binaryMessenger: controller.binaryMessenger
)
self.notificationInteractionChannel?.setMethodCallHandler { (call, result) in
switch call.method {
case "getInitialNotificationInfo":
result(self.initialNotificationInfo)
self.initialNotificationInfo = nil
default:
break
}
}
}
}