App crashes after push notification is tapped when app is killed

Comment these 2 lines

// window = UIWindow(frame: UIScreen.main.bounds)
// window?.makeKeyAndVisible()

as overriding the window property destroys the initialization from storyboard (makes rootVC nil) and before return true window must have one