I somehow can not receive the device token when registering for remote notifications. I get the modal saying \"Do you want to allow App X to be able to send you notificaitons\",
For Swift 5, I have used like this,
let settings = UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil) application.registerUserNotificationSettings(settings) UIApplication.shared.registerForRemoteNotifications()