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:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user