How to request device token on iphone

Posted by Greg on Stack Overflow See other posts from Stack Overflow or by Greg
Published on 2010-05-08T19:53:33Z Indexed on 2010/05/08 19:58 UTC
Read the original article Hit count: 359

Filed under:
|
|

Hello, I am able to use the didRegisterForRemoteNotificationWithDeviceToken callback method to get the device token of my iphone when subscribing to push notifications. My question is how can I get this token again a later time? When a user subscribes to something in my application, I want to send the device token and the id of the item they are subscribing to...but I can't figure out where to get the device token from. I tried using the uniqueIdentifer from the UIDevice class but this value is different than what the original token was. I supposed I could call registerForRemoteNotificationTypes each time my app starts to produce the token. But if I do that, I'm not sure how I can access this value from a different class (my didRegisterForRemoteNotificationWithDeviceToken callback is located in the main application delegate). Thanks for any help for an objective C newbie!

© Stack Overflow or respective owner

Related posts about iphone

Related posts about push