Search code examples
iosswiftpush-notificationapple-push-notificationsdevicetoken

Retrieve the app push token from the device automatically in swift iOS


Is it possible to get a device token (push token) automatically or without registering for push notification in iOS Swift?

Currently, we are getting device token while registering for push notifications:

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    ...
}

Solution

  • It's not possible. We can not retrieve the app push token from the device automatically or without registering for push notification in swift iOS