ios - Get device token in static library -


I have to get the device token from the Apple Push Notification server in the static library.

This means that the user does not need to implement the DeRegisterForRemoteNotificationsWithDeviceToken method in AppDelegate, I have to handle it myself, and get the device token.

  • This is where the device is possible to get another token in the program?

  • Is there a way that will inform me when the device token is generated?

Because I have to register a device token after the user logs-in. So I have implemented my code such as

  1. didRegisterForRemoteNotificationsWithDeviceToken I am speaking static library method to save device token (This will save device token in NSUSerDefault)

  2. After the user logs in, I am sending the device token to the server to add the device token to the database.

I do not have to save the device token and then to register, I have to log the device token once the user has to log in and send it to the server.

So, is this possible?

Thanks & amp; Push is the only way to get the device token: Regards, Abbas Mulani

didRegisterForRemoteNotificationsWithDeviceToken After registration for the information from Apple (by calling RegisterForRemoteNotificationTypes: ). This method, so that it can be accessed by the need of it, where ever you need it to pass the device token, or store it in a steady store (such as NSUSerDefault ) can do.

If you want to get the device token form Apple only when the user logs in, you should call registerForRemoteNotificationTypes: only when


Comments