Introduction
Often, in case of issues with push notifications, Pushwoosh support team asks the customers to provide an entire console log from the device in order to better investigate the possible issue.
Why is this necessary? There may be many reasons why notifications are not displayed on the device and the first thing to check is that a device is registered for push notifications. It is even easy enough for you to do by yourself as a first troubleshooting step!
Required actions
Let's look at obtaining the device console log for iOS.
- First, if you have access to your app's source code, make sure that
Pushwoosh_LOG_LEVEL
in your application is set toVERBOSE
. In order to do this, checkPushwoosh_LOG_LEVEL
string key in yourInfo.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 informationVERBOSE
- Everything SDK can print and more
The VERBOSE
key value allows Pushwoosh SDK to display important information regarding registration actions.
Controlling Log Level for native iOS. Pushwoosh Documentation
- Further, connect the device to your Mac and launch Xcode. Go to Window => Devices and Simulators.
- In the opened window, 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 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!
__________________________________________________________________________________________________________
- Next, start your application on the device and wait for the dialog window. Allow Push notifications for your application.
After these steps, select the entire device log from the console window and copy it to any text redactor.
/registerDevice
Pushwoosh API request is that what you are looking for.
If the device is properly registered, this request must contain the following parameters below:
x
| Pushwoosh request:
| Url: https://D868A-C13C1.api.pushwoosh.com/json/1.3/registerDevice
| Payload: {"request":{"gateway":"production","jailbroken":0,"app_version":"1.9","application":"D868A-C13C1","sounds":["bubble.wav"],"device_type":1,"userId":"1457691684303547","language":"en","hwid":"FBCA07FE-05EE-4770-B4BA-AB6737BC1A98","package":"com.pushwoosh.pushon","timezone":"25200","push_token":"ae784019d1b8c8e38a1ea06f0800c17a4fa986d6e2d346fc79373e92439ff8f7","os_version":"11.2.2","v":"5.5.1","device_model":"iPhone7,1"}}
| Status: "200 no error"
| Response: {"status_code":200,"status_message":"OK","response":{"iosCategories":[{"categoryId":0,"buttons":[{"id":"33389","label":"test","type":"0","startApplication":0},{"id":"1233","label":"ajhdkj","type":"1","startApplication":0}]}]}}
x
The notice with a push token of your device should present as well.
<Notice>: [PW] [I] -[PWPushNotificationsManagerCommon] Registered for push notifications: ae784019d1b8c8e38a1ea06f0800c17a4fa986d6e2d346fc79373e92439ff8f7
Below you can find the same actions for the Android platform.
If you have access to app's source code, make sure that Pushwoosh log level is set to NOISE
.
To do so, add com.pushwoosh.log_level
meta-data with value NOISE
to the AndroidManifest.xml
Controlling Log Level for native Android. Pushwoosh Documentation
- Next, run Android Studio on your Mac/PC and go to Tools => Android => Android Device Monitor.
- Connect your device to the Mac/PC and launch the application. 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 recent versions of Android Studio you can also use Logcat tool to obtain 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 Pushwoosh /registerDevice API request looks like within the device console log:
[RequestManager]
x
| Pushwoosh request:
| Url: https://D868A-C13C1.api.pushwoosh.com/json/1.3/registerDevice
| Payload: {"request":{"application":"D868A-C13C1","hwid":"fc79efabee7649ec","v":"5.5.2","device_type":3,"userId":"fc79efabee7649ec","device_name":"Phone","language":"en","timezone":25200,"android_package":"com.pushwoosh.pushon","jailbroken":0,"device_model":"Sony F8332","os_version":"8.0.0","idfa":"d43ad490-4e6a-48a8-b8b9-f20b76fbf07b","app_version":"1.5","push_token":"dwMAeCRabUE:APA91bGSk8SqCSycxfltrWCV9KtXGo48-8qvNKfzHn758PW7lLXSi_Wd7y3gqw-lbexsjLwsaXStpELTJUAQVZ3ybNqAUmfw-we-62rTjpNbvBa4oPYTwaPCr3s4M05xNv8jGau-MeA_","sounds":"[]"}}
| Response: {"status_code":200,"status_message":"OK","response":null}
x
[RequestManager] registerDevice response success
I/Pushwoosh(12733): [DeviceRegistrar] Registered for pushes: dwMAeCRabUE:APA91bGSk8SqCSycxfltrWCV9KtXGo48-8qvNKfzHn758PW7lLXSi_Wd7y3gqw-lbexsjLwsaXStpELTJUAQVZ3ybNqAUmfw-we-62rTjpNbvBa4oPYTwaPCr3s4M05xNv8jGau-MeA_
03-30 14:45:10.539: D/PushOn(12733): Registered for push notifications
Comments
0 comments
Please sign in to leave a comment.