I am trying to use the new UserNotifications framework for local notifications. I redirect the user to a different viewcontroller when the notification is clicked/open. The notification is not handled properly by UNUserNotificationCenterDelegate didReceive
method.
When the notification is in the foreground, and then it is clicked, it redirects to the right viewcontroller, however, when the app is closed and the notification is opened, the app is launched, however, the main viewcontroller is displayed instead.