-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent behaviour sending data payload on apns vs. fcm #141
Comments
@ghard , There are two separate "issues" I can see here:
|
@ghard , Actually, the error codes you show very much suggest you're using |
Re. v3 API: I would love to RTFM - however I don't Elixir and all examples and documentation ias n README.md refer to /v2 URLs only. I had no idea there even is such a thing as v3. |
Indeed, even though documentation reflects |
Also:
|
Swagger is disabled in |
Maybe this could be exposed somewhere public, linked from the README.md? |
Never hurts to have an authoritative source for an API document somewhere. |
Yeah, that's true. I'll be pushing for external documentation anyway very soon, as |
Swagger is somewhat standardised, so it is a good formal way of defining the API. If it is already a build artefact, it could easily be added as an item in releases as well - as a file one could also extract from the docker image, or separately. |
Okay. I am trying to send some test data to FCM - this is what my request JSON looks like:
I get an 200 reply and the alert gets shown on my 'droid. However the data payload is null. This is what I see on the DEBUG log of MongoosePush - I'm having my worries about the notification as well as the data nodes being empty in what I suppose is being sent to FCM:
Am I still doing something wrong here? I've been successfully passing alerts with data payloads to our iOS clients with the v2 api for months so I guess I'm calling it correctly. |
I am not sure what is the issue here. There is |
Closing the issue due to lack of activity. |
It looks like the there's a discrepancy with how data payloads are handled between APNS abd FCM:
On 1.x using old FCM API I had no issues here. This behaviour is observed using the docker image mongooseim/mongoose-push:2.0.2
This is the JSON sent to mongoose-push:
And here's some of what I get back when sending this to 2 FCM and 2 APNS clients:
This seems all fine: One of the FCM tokens is indeed expired.
(I do object to using a 500 reply here; probably 400, 404 or 410 would be more adherent to HTTP semantics as we're HTTP POSTing to a resource which doesn't exist. It certainly is not an "Internal server error", but I digress.)
How about something a bit more interesting?
Wha-what?!
(Actually this time I think it MIGHT be the server's fault re. 500 reply, but not so sure.)
As seen on docker logs:
Also sprach documentation on https://github.com/esl/MongoosePush:
"data (optional) - custom JSON structure sent to the target device. For APNS, all keys form this stucture are merged into highest level APS message (the one that holds 'aps' key), while for FCM the whole data json stucture is sent as FCM's data payload along with notification."
There seem to be no reservation there as per how complex or simple this json structure may be.
Maybe there is something else at play here? Failing deep-copy of the JSON structure perhaps?
The text was updated successfully, but these errors were encountered: