didRegisterForRemoteNotificationsWithDeviceToken
is the only way to get the device token from Apple after registering for push notifications (by calling registerForRemoteNotificationTypes:
). This method can pass the device token to where ever you need it, or store it in some persistent store (such as NSUSerDefault
), so that it can be accessed by who ever needs it.
If you want to get the device token form Apple only when the user logs in, you should call registerForRemoteNotificationTypes:
only when the user logs in.