Comments (13)
@ghard ,
There are two separate "issues" I can see here:
-
The
UNREGISTERED
error should not be HTTP 500 - I have no idea why this happens, as this was a bug that has been recently "fixed". Can you please let me know if you're sure that this is2.0.2
releases? And if it indeed is, can you share more logs surrounding this HTTP 500 UNREGISTERED? It really should've been HTTP 410. -
Deep data payloads - according to FCM documentation (https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#Notification), both keys and values in
data
have to be of typestring
. There is very little we can do about it apart from returning proper HTTP 400 code.
from mongoosepush.
@ghard ,
Actually, the error codes you show very much suggest you're using v2
API. Can you confirm that? If so, just try to switch to v3
, the only changes are in response error codes (v2
used 500 for almost anything).
from mongoosepush.
cba7dc8b4e2c mongooseim/mongoose-push:2.0.2 "/opt/app/bin/mongoo…" 2 days ago Up 2 days 127.0.0.1:8443->8443/tcp mongoose-push
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.
from mongoosepush.
Indeed, even though documentation reflects v3
changes (error code list), examples still show v2
in URL's - will fix that.
from mongoosepush.
Also:
$ curl http://localhost:8443/swagger.json
curl: (52) Empty reply from server
from mongoosepush.
Swagger is disabled in prod
right now, only available when compiling from source in dev
environment. In 2.1
this will be configurable.
from mongoosepush.
Maybe this could be exposed somewhere public, linked from the README.md?
from mongoosepush.
Never hurts to have an authoritative source for an API document somewhere.
from mongoosepush.
Yeah, that's true. I'll be pushing for external documentation anyway very soon, as README.md
gets very crowded already - maybe Swagger (OpenAPI 3.0 after 2.1
release) could be part of that too.
from mongoosepush.
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.
from mongoosepush.
Okay. I am trying to send some test data to FCM - this is what my request JSON looks like:
"{\"service\":\"fcm\",\"topic\":\"com.example.app\",\"mode\":\"prod\",\"alert\":{\"title\":\"Hello\",\"body\":\"World oyster\"},\"data\":{\"event_data\":\"eyJtZWgiOiJib2luZyJ9\"}}"
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:
2020-03-17T11:09:41.172 [debug] pid=<0.1842.0> action=canceling_timer, request=%Sparrow.H2Worker.RequestState{body: "{\"message\":{\"android\":{\"data\":{\"event_data\":\"eyJtZWgiOiJib2luZyJ9\"},\"notification\":{\"body\":\"World oyster\",\"title\":\"Hello\"}},\"data\":{},\"notification\":{},\"token\":\"<redacted>\"}}", from: {#PID<0.28165.43>, #Reference<0.3784988276.708837377.52463>}, headers: [{"content-type", "application/json"}], path: "/v1/projects/myapp/messages:send", timeout: nil, timeout_reference: #Reference<0.3784988276.708837377.52470>}, result=4901
... stuff deleted ...
2020-03-17T11:09:41.173 [debug] pid=<0.28165.43> Sent 200 in 103ms
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.
from mongoosepush.
I am not sure what is the issue here. There is .message.android.data
filled according to you request in the log that you provided. The .message.data
is indeed empty, but according to FCMv1 docs, .message.android.data
overrides .message.data
when available (https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#AndroidConfig).
from mongoosepush.
Related Issues (20)
- 1.0.5 release docker image has faulty ssl-9.2 HOT 2
- KEY_ID TEAM_ID apns HOT 1
- FCM error: Unable to complete push request due to service error: INVALID_ARGUMENT in category: invalid_request HOT 3
- MAM query archive response containing empty 'to' field HOT 1
- mongoosepush start error HOT 5
- Unauthorized error HOT 4
- Getting genserver crash every few minutes HOT 3
- Swagger HOT 2
- TooManyProviderTokenUpdates HOT 3
- MongoosePush crashes at startup HOT 2
- MongoosePush crashes at startup HOT 1
- When hit MongoosePush API nothing to show in web browser HOT 1
- Failed to start H2 connection HOT 1
- where do I find sys.config? HOT 1
- Is it possible to disable SSL certificate for http endpoint? HOT 2
- Question - Is it possible to disable Push Notifications based on a user's 'Do not disturb' status? HOT 2
- Crash at startup with token.p8 - bad_auth HOT 3
- FCM not sending notification HOT 2
- Server cannot create ssl connection HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongoosepush.