Pushwoosh / pushwoosh-phonegap-plugin

Pushwoosh PhoneGap Build Plugin
Other
109 stars 139 forks source link

Device appears not be registering on pushwoosh servers #342

Closed CodeWithOz closed 3 years ago

CodeWithOz commented 3 years ago

Hi, I'm getting the UnknownDevices error when trying to send push notifications to a device. According to this post, one reason could be that the device is not registered on pushwoosh's servers. I have followed the instructions here for setting up the plugin and registering the device correctly. How can I confirm if the device is actually being registered to Pushwoosh by this plugin? The success callback of registerDevice is invoked inside the app, but I'm not certain that this means the device token was successfully saved to pushwoosh because I'm still getting the UnknownDevices error. Would appreciate some help/guidance, thanks.

wfhm commented 3 years ago

@CodeWithOz,

How can I confirm if the device is actually being registered to Pushwoosh by this plugin?

You can check device console logs and search for a /registerDevice API call. There should be something like:

2020-10-03 02:01:16.148 5933-6013 I/Pushwoosh: [RequestManager]
    x
    |    Pushwoosh request:
    | Url: https://xxxxx-xxxxx.api.pushwoosh.com/json/1.3/registerDevice
    | Payload: {"request":{"application":"xxxxx-xxxxx","hwid":"xxxxx-xxxxx","v":"6.0.6","device_type":3,"userId":"xxxxx-xxxxx","device_name":"Phone","language":"en","timezone":10800,"android_package":"xxxx","jailbroken":1,"device_model":"Google AOSP on IA Emulator","os_version":"9","app_version":"1.0","notificationTypes":6,"push_token":"pushtoken","sounds":[]}}
    | Response: {"status_code":200,"status_message":"OK","response":null}
    x

Check the response, if it is like on this screenshot, then the registration request was received by our backend without any issues.

Troubleshooting this issue might require access to your account data, so I would recommend creating a support ticket at https://help.pushwoosh.com/hc/en-us/requests/new to avoid exposing it publicly here. Submit a ticket and provide information about the notifications that return UnknownDevices responses, specify your Application ID and share the log from your app with the /registerDevice API request body and response.

Also, I have just tried registering with a Cordova app and it works fine with the latest plugin version, so it does not look related to the plugin itself, so I am closing this issue for now.