Pushwoosh / pushwoosh-phonegap-plugin

Pushwoosh PhoneGap Build Plugin
Other
110 stars 139 forks source link

Best way to register application ID with pushwoosh on launch #170

Closed javacado closed 8 years ago

javacado commented 8 years ago

I have noticed that (sometimes, seemingly at random) pushwoosh inits itself before I call it in my code. As a result it doesn't have the application ID in the request, and so fails. Later (in the code), when I do invoke it, it doesn't retry these requests below.

After writing this and relaunching the app several times I was only able to reproduce it once. I think it has to do with the loading order of my plugins?

 Pushwoosh request:
| Url:      https://cp.pushwoosh.com/json/1.3/registerUser
| Payload:  {"request":{"device_type":1,"application":"","userId":"XXXXXXX-XXXXXX-XXXXXX-XXXXXXXX","v":"3.1.1.434","hwid":"XXXXXXX-XXXXXX-XXXXXX-XXXXXXXX"}}
| Status:   "200 no error"
| Response: {"status_code": 210, "status_message": "Request format is not valid."}
x
2016-03-22 11:25:31.204 LocalHapsApp[867:732887] [PW] [I] -[PWRequestManager] 
x
|    Pushwoosh request:
| Url:      https://cp.pushwoosh.com/json/1.3/getInApps
| Payload:  {"request":{"device_type":1,"language":"en-US","application":"","userId":"XXXXXXX-XXXXXX-XXXXXX-XXXXXXXX","v":"3.1.1.434","hwid":"XXXXXXX-XXXXXX-XXXXXX-XXXXXXXX"}}
| Status:   "200 no error"
| Response: {"status_code":210,"status_message":"Application not found","response":null}
x
2016-03-22 11:25:31.233 LocalHapsApp[867:732918] [PW] [I] -[PWRequestManager] 
x
|    Pushwoosh request:
| Url:      https://cp.pushwoosh.com/json/1.3/applicationOpen
| Payload:  {"request":{"userId":"XXXXXXX-XXXXXX-XXXXXX-XXXXXXXX","app_version":"0.3.9","hwid":"XXXXXXX-XXXXXX-XXXXXX-XXXXXXXX","language":"en","os_version":"9.2.1","package":"com.ionicframework.localHapsApp","v":"3.1.1.434","application":"","device_type":1,"jailbroken":0,"device_model":"iPhone8,1"}}
| Status:   "200 no error"
| Response: {"status_code":210,"status_message":"Application not found","response":null}
shaders commented 8 years ago

It's a known issue and these errors are harmless, please ignore them. It's going to be fixed in the next plugin version.

ghost commented 8 years ago

So this is what threw me. I was getting responses from the plugin because it was initing itself but it was locking up later when I tried to init it, because of the change in the plugin name :-1:

javacado commented 8 years ago

curiously, when is the next version of the plugin sched'd to be released?

shaders commented 8 years ago

@javacado we are going to release big update next week.

DimanAM commented 8 years ago

Fixed in 5.0.0