To get the device token, you have several options:
Option 1
You can find it as one of the arguments sent in the delegate method of application:didRegisterForRemoteNotificationsWithDeviceToken:
Option 2
You can get it as an NSString by calling [[UAPush shared] deviceToken] after your device has successfully registered for remote notifications.
Option 3
If you do not have access to the code. You can find it by reading your app calls for a city airship. You can do this using Charles proxy. Complete guide to this link. Summarizing:
- Install the Charles certificate on the iOS device at http://charlesproxy.com/charles.crt in safari on your device.
- Proxy wirelessly connect your device through Charles
- Enable SSL proxying in Charles for
*.urbanairship.com on port 443. - Launch the app and find calls to URLs that mention "urbanairhip" that were recorded in Charles. They must be decrypted, and some will contain information about your device token.
ohnit
source share