Is there a way to prompt the user to enable push notifications when it actually makes sense? Put another way, instead of prompting the user to enable push notifications as soon as the app is launched for the first time (with code in app delegate), delay the prompt to after a specific point in the app (post walkthrough for example).
I have seen several apps that do that including Google Photos and Uber but I am not clear which piece of code actually triggers the on screen dialog and if I can place it anywhere in the app. I assume it is the following (in Swift):
UIApplication.sharedApplication().registerForRemoteNotifications()
let settings = UIUserNotificationSettings(forTypes: [.Alert, .Badge, .Sound], categories: nil)
application.registerUserNotificationSettings(settings)