I'm running into a strange problem. When I request for remote notifications authorization inside the didFinishLaunchingWithOptions using the below code, I'm able to get a push remote notification from my server (Firebase Messaging) but when I try to request for authorization at later time NOT INSIDE didFinishLaunchingWithOptions I'm not able to get any notification.
I don't want to ask for authorisations at the launch time. I want to ask for authorization after the user have logged in for example.
Apple documentation says:
Always call this method before scheduling any local notifications and before registering with the Apple Push Notification Service. Typically, you call this method at launch time when configuring your app's notification support. However, you may call it at another time in your app's life cycle, providing that you call it before performing any other notification-related tasks.
// For iOS 10 display notification (sent via APNS)
UNUserNotificationCenter.current().delegate = self
let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
UNUserNotificationCenter.current().requestAuthorization(
options: authOptions,
completionHandler: {_, _ in })
UIApplication.shared.registerForRemoteNotifications()
Any suggestion/solution to this problem?
App Info: Deployment Target: iOS 10.3 iOS Devices: iPhone 6 with iOS 10 / iPhone 7 with iOS 11