Closed nunomarks closed 8 years ago
Found out that it's raising an MissingRegistration error.
@amportugal Which version of python-gcm are you using? (from where did you install it?)
@mnemonicflow I used version 0.2 and have the same error, after I debug, request is missing header Content-Type: application/x-www-form-urlencoded;charset=UTF-8 ( https://developers.google.com/cloud-messaging/http ) Missing header is reason gcm request sometime success but sometime error. (With request error, I tested by manual request with the same content just add header Content-Type: application/x-www-form-urlencoded;charset=UTF-8)
Thanks.
@truyet That has been fixed in master branch https://github.com/geeknam/python-gcm/blob/master/gcm/gcm.py#L278 . But this problem might be related #84 which I investigated here: https://github.com/geeknam/python-gcm/issues/84#issuecomment-147240625 and is only reproducible in 0.2 tag We plan to release 0.3 version, in the meantime try the master branch.
@nemonicflow Yes, I used code in master branch and see you fixed it, thank you. But I think you need review retries in gcm request function (plaintext_request, json_request) because it is looped while gcm request is success.
0.3 is now live: https://pypi.python.org/pypi/python-gcm
@truyet I will have a look at it. But I haven't found that to be the case. I will try to test your assertion.
@truyet the problem with the loop inside plaintext_request has been fixed. See #98 and https://github.com/geeknam/python-gcm/commit/6ef1313455f049f318c1381cb5c37238ed24a1aa Getting a None response from plaintext_request when success is a legitimate return value in case where there is no error and the token hasn't changed. (i.e. wasn't replaced by a canonical_id)
We need to provide a way to return the message id when success but still be backwards compatible with old clients that except None as the return value when success.
When doing
The response variable comes as "None". Why so?