The above answer by Alex works, if your view controller that handles the notification happens to be on screen when the notification comes in, but often times its not. In
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any])
You want to update your badge count, and then check the notification. Depending on what kind of notification you have you either handle it silently (perhaps using the Notification Center method above) or you launch the appropriate view controller and either pass it the whole notification or just the id and have the view controller call your API with the id to get all of the details. You do this just as you would normally change view controllers, so if its a navigation controller, you instantiate the new view controller, pass it the data, then push it on the navigation controller.
let notificationTableViewController = UIStoryboard(name: Identifiers.Storyboard.Notification, bundle: nil).instantiateViewController(withIdentifier: String(describing: NotificationTableViewController.self)) as!
NotificationTableViewController
controller.notificationId = notificationId
rootNavigationController?.pushViewController(notificationTableViewController, animated: true)
If you have a tab bar application you switch tabs first. If you have some kind of custom navigation, you need to call the appropriate method on your container class.