Device identifiers
How to obtain IDs Pushwoosh uses for registered devices
There are two ways to identify a particular device registered with Pushwoosh – a hardware ID (HWID) and a push token.
HWID
HWID (or Hardware ID) is a key identifier assigned to the device by Pushwoosh SDK.
Android HWID
For Android devices, HWID is a random set of letters and digits generated by the first app with the Pushwoosh SDK installed on the device. It's later shared with other apps that contain Pushwoosh SDK so that all such apps will have the same HWID as a result.
However, if a user deletes all the apps with Pushwoosh SDK and then re-installs some, a new HWID will be generated once again.
Android HWID example: 5dcaed99-e1e0-44dc-bde2-b96188b99e9e
iOS HWID
For iOS devices, IDFV (Identifier for Vendor) is being used as a HWID of the device. It won't change as long as there is at least one app from the same vendor installed on the device.
iOS HWID example (upper case only!):CBAF8ED1-17FB-49A3-73BD-DC79B63AEF93
Push token
Push token (device token) is a unique key for the app-device combination issued by the Apple or Google push notification gateways. It allows gateways and push notification providers to route messages and ensure the notification is delivered to the unique app-device combination for which it is intended.
iOS push token
iOS device push tokens are strings with 64 hexadecimal symbols. iOS push token example: 03df25c845d460bcdad7802d2vf6fc1dfde97283bf75cc993eb6dca835ea2e2f
Make sure that the iOS push tokens you use when targeting specific devices in your API requests are in lower case.
Android push token
Android device push tokens can differ in length (usually below 255 characters) and typically start with APA91b…; however, it might also have a colon-separated prefix. Android push token example: APA91bFoi3lMMre9G3XzR1LrF4ZT82_15MsMdEICogXSLB8-MrdkRuRQFwNI5u8Dh0cI90ABD3BOKnxkEla8cGdisbDHl5cVIkZah5QUhSAxzx4Roa7b4xy9tvx9iNSYw-eXBYYd8k1XKf8Q_Qq1X9-x-U-Y79vdPq
Using raw device tokens for targeting specific devices is not the most reliable way because FCM push tokens tend to change from time to time, and it’s hard to tell how often it occurs.
How to obtain HWID and push token
iOS
First, if you have access to your app’s source code, make sure that Pushwoosh_LOG_LEVEL
in your app is set to VERBOSE
. To do this, check the Pushwoosh_LOG_LEVEL
string key in your Info.plist
file. If not, skip to the next step. Here are the possible values for this key:
NONE
- No logs from SDKERROR
- Only display errors in the consoleWARNING
- Also, display warningsINFO
- Add informational messagesDEBUG
- Add debug infoVERBOSE
- All logs from SDK
The VERBOSE
key value allows the Pushwoosh SDK to display important information regarding registration actions.
2. Further, connect the device to your Mac and launch Xcode. Go to Window->Device and Simulators.
3. In the window opened, select your connected device and click the up-triangle at the bottom left to see the device console:
Starting from Xcode 9.3 version, the process of obtaining the device console log is slightly changed. All you need to do is to go to your Launchpad and start the "Console" application. Select your device in the left sidebar. That’s it!
4. Next, start your app on the device and wait for the dialog window. Allow push notifications for your app.
5. After these steps, select the entire device log from the console window and copy it to any text redactor.
/registerDevice
Pushwoosh API request is what you are looking for:
If the device is registered correctly, this request must contain the following parameters, including "hwid" and "push token" values:
The notice with a push token of your device should present as well:
Android
1. If you have access to the app's source code, make sure that the Pushwoosh log level is set to NOISE
. To do so, add com.pushwoosh.log_level
meta data with the value NOISE
to the AndroidManifest.xml
.
2. Next, run Android Studio on your Mac/PC and go to Tools -> Android -> Android Device Monitor.
3. Connect your device to the Mac/PC and launch the app. Wait about 30 seconds, select the entire device log from the console window and copy it to any text redactor.
Please note that in the latest versions of Android Studio, you can also use the Logcat tool to obtain the device console log. Run Android Studio and go to View -> Tool Windows -> Logcat:
After that, you can locate the device log in the Logcat window:
Here's the example below, how the Pushwoosh /registerDevice API request looks like within the device console log:
Find the "hwid" and "push token" params' value in the request:
Push token is included in the device registrary notice:
Chrome (desktop)
1. Go to your website.
2. Right-click anywhere on the page and press "Inspect".
3. In the window opened, go to the "Application" tab.
4. Then, on the left sidebar, choose IndexedDB -> Pushwoosh_SDK_Store -> keyValue. Here, find the HWID and push token params.
Chrome (mobile)
1. Connect your mobile device to the computer.
2. Go to chrome://inspect/#devices on your desktop Chrome.
3. Open your website on your mobile Chrome.
4. Once the website is opened on your mobile Chrome, you will see the corresponding page within the desktop Chrome page. Please take a look at the screenshot below:
5. Press the "Inspect" button highlighted in the screenshot above.
6. The following window will appear on your desktop Chrome. There, within the "Application" tab, open IndexedDB -> PUSHWOOSH_SDK_STORE. After this, click keyValue and open the API_PARAMS section:
In the API_PARAMS section, you will find the "hwid" and "push token" parameters with their values.
Safari
Go to your website.
Right-click anywhere on the page and select Inspect Element.
Go to the Storage tab -> Indexed Databases -> PUSHWOOSH_SDK_STORE -> keyValue.
Expand the API_PARAMS and find the "hwid" and "push token" values here.
Last updated