Where can I get the device token that is required for Urban Airship to register iOS?

From the online API:

HTTP PUT to / api / device_tokens / registers the device token at our end. This allows us to know that the device token is active and should be executed every time the application is opened to make sure that the device token list remains up to date.

How can I purchase a device token first?

+7
source share
2 answers

I believe that you need to look here : implement the application:didRegisterForRemoteNotificationsWithDeviceToken to get the device token.

EDIT: A Guide to the City Airship is located at http://urbanairship.com/docs/apns_test_client.html .

EDIT: The only way to send an APNS message is to use a device token: you need to transfer the device token back depending on which non-Apple server is the starting point for the notification. There are 3 logical objects in a transaction: a device, an APNS server (Apple backend), and a source server (in this case, an Urban Airship server). Apple device and backend already have a token (or can generate one). The Urban Airship server receives this token only when you send it from the device. He can then use this token to communicate with the APNS server and identify the device. What you do is use the application:didRegisterForRemoteNotificationsWithDeviceToken , and then you send (via HTTP or any other wired protocol that you choose) that token to the source server (Urban Airship docs show how to do this with their library) . Their server can now use this token to communicate with the APNS backend.

+7
source

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.
+2
source

All Articles