You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How would we go about developing a push adapter for FCM. Projects created in Google Console seem to now be required to use Firebase Cloud Messaging instead of GCM. I've tried to start an FCM adapter by copying the GCM adapter where I could but I'm changing certain parts when needed based on fcm-node documentation.
We could add a new handler here for fcm, so it processes properly fcm based push alongside GCM. The FCM compatible installations will have pushType set to fcm instead of gcm. What do you think?
Oh, I haven't added the Firebase sdk to my app so the token must be generated by parse. Basically, I'm running parse-server as usual but have setup fcm (which created a serverkey and senderId). I'm then placing that key and id in parse-server just like I would with gcm key and id. Sorry for the confusion.
All device tokens acquired with GCM should work with FCM. But if you changed your senderID and serverKey, that's likely to be problematic IMHO yet I'm not sure
The thing is I haven't setup gcm with parse-server. I was using push through hosted parse but it didn't require me to create an app for gcm. Now the only option we have is to add fcm instead of gcm and it doesn't seem to be working. I setup my parse app (and server side) just like how you would with gcm and added the fcm credentials to it, which is really only the server key but that shouldn't be any different.
But without notification field nothing is displayed on the Android device. What's the point of having notifications working but not having them displayed on the screen?
I pulled and compiled fcm-adapter branch and seems to be working fine if you set the device's pushType equal to fcm (also need to add fcm to parse push notifications). Not sure how stable the fcm-adapter branch is though.
Mhhh...could you explain me a bit further? If I use master branch, what do I need to change on the Android App (or in my server when requesting a push notification) in order to get Push Notifications DISPLAYED on the phone screen?
This is how I am requesting the push notification and it is not being displayed on the Android screen. Am I missing something?:
Okay, Just like someone did in the fcm-adapter. The thing is that there is no such feature in parse then, correct? There is no way, currently, to display android notifications in the phone screen using parse-server.
BTW...thank you so much for your quick responses @flovilmart and for helping me to troubleshoot this
Awesome! It just feels weird I am the only one seeing this issue (thought multiple people are using parse for sending push notifications).
I will try to put something together to overcome this problem. But I am only seeing this problem when using fcm setttigs and the gcm sender from parse.
I will try to create a pull request (need to catch up on the repo rules first)...
I see the fcm-adapter is doing kind of the same here. Any other thought on your side @flovilmart ?
The fcm branch is abandoned and should be deleted, as I thought that fcm was not compatible with the node-gcm package. You can get some inspiration from there definitely.
@mmazzarolo will see if I grab some spare time these days and create a pull request...should be as simple as taking into account notification field when sending the GCM in the GCM.js file. Let me know if you are experiencing some other issue we can see if we can add support for other options that can be sent to Android phones.
These are the fields supported in the gmc/fmc payload:
Activity
flovilmart commentedon Sep 4, 2016
We could add a new handler here for fcm, so it processes properly fcm based push alongside GCM. The FCM compatible installations will have pushType set to fcm instead of gcm. What do you think?
thailey01 commentedon Sep 4, 2016
That'd be perfect! Wish I could help in some way.
flovilmart commentedon Sep 7, 2016
No need for the FCM adapter, just initialize with the right key and the GCM adapter pushes will automagically send everything correctly!
thailey01 commentedon Sep 7, 2016
Don't you need a serverapi key and a project number? I don't think firebase supplies the project number or key.
thailey01 commentedon Sep 7, 2016
Nevermind, Firebase creates a senderId and Server Api Key which can be found in the project settings.
thailey01 commentedon Sep 8, 2016
Do we still have to add firebase to our projects? I set the senderId and apiKey found in Firebase but the message wasn't pushed.
flovilmart commentedon Sep 8, 2016
Does the token was acquired with the firebase SDK? Not sure about the compatibility here
thailey01 commentedon Sep 8, 2016
When setting up fcm, the Firebase console automatically creates a senderId and a serverApiKey.
flovilmart commentedon Sep 8, 2016
I means the android device tokens. Maybe we should still let gcm and fcm token live separately.
thailey01 commentedon Sep 8, 2016
Oh, I haven't added the Firebase sdk to my app so the token must be generated by parse. Basically, I'm running parse-server as usual but have setup fcm (which created a serverkey and senderId). I'm then placing that key and id in parse-server just like I would with gcm key and id. Sorry for the confusion.
flovilmart commentedon Sep 8, 2016
All device tokens acquired with GCM should work with FCM. But if you changed your senderID and serverKey, that's likely to be problematic IMHO yet I'm not sure
thailey01 commentedon Sep 8, 2016
The thing is I haven't setup gcm with parse-server. I was using push through hosted parse but it didn't require me to create an app for gcm. Now the only option we have is to add fcm instead of gcm and it doesn't seem to be working. I setup my parse app (and server side) just like how you would with gcm and added the fcm credentials to it, which is really only the server key but that shouldn't be any different.
flovilmart commentedon Sep 8, 2016
@inlined may have more input on that.
23 remaining items
flovilmart commentedon Oct 28, 2016
As you mention, the current adapter works with FCM, just the notification field is missing.
Do you want to make a pull request to support that?
felimartina commentedon Oct 28, 2016
But without
notificationfield nothing is displayed on the Android device. What's the point of having notifications working but not having them displayed on the screen?I pulled and compiled
fcm-adapterbranch and seems to be working fine if you set the device's pushType equal tofcm(also need to addfcmto parse push notifications). Not sure how stable thefcm-adapterbranch is though.flovilmart commentedon Oct 28, 2016
There is no need to use the fcm branch, the master branch should work correctly with fcm
felimartina commentedon Oct 28, 2016
Mhhh...could you explain me a bit further? If I use
masterbranch, what do I need to change on the Android App (or in my server when requesting a push notification) in order to get Push Notifications DISPLAYED on the phone screen?This is how I am requesting the push notification and it is not being displayed on the Android screen. Am I missing something?:
FYI...I am
using parse-server-push-adapterfrom npm (1.1.0). Is that the very same version that holds themasterbranch?flovilmart commentedon Oct 28, 2016
See the node-gcm documentation here: https://www.npmjs.com/package/node-gcm
The notification key is not set when creating the gcm.message here:
https://github.com/parse-server-modules/parse-server-push-adapter/blob/master/src/GCM.js#L124
and here:
https://github.com/parse-server-modules/parse-server-push-adapter/blob/master/src/GCM.js#L60
felimartina commentedon Oct 28, 2016
That is what I mean.
Let me re-phrase. How do I do in order to DISPLAY a notification on an Android phone?
flovilmart commentedon Oct 28, 2016
One need to open a pull request, follow the examples from the node-gcm package and implement the notification key inside the GCM payload.
felimartina commentedon Oct 28, 2016
Okay, Just like someone did in the
fcm-adapter. The thing is that there is no such feature in parse then, correct? There is no way, currently, to display android notifications in the phone screen usingparse-server.BTW...thank you so much for your quick responses @flovilmart and for helping me to troubleshoot this
flovilmart commentedon Oct 28, 2016
I believe this is a change in the google API's and we didn't catch it up. Because you caught it, that would be nice if you provide the fix too.
felimartina commentedon Oct 28, 2016
Awesome! It just feels weird I am the only one seeing this issue (thought multiple people are using parse for sending push notifications).
I will try to put something together to overcome this problem. But I am only seeing this problem when using
fcmsetttigs and thegcmsender from parse.I will try to create a pull request (need to catch up on the repo rules first)...
I see the
fcm-adapteris doing kind of the same here. Any other thought on your side @flovilmart ?Again, thanks for everything
flovilmart commentedon Oct 28, 2016
The fcm branch is abandoned and should be deleted, as I thought that fcm was not compatible with the node-gcm package. You can get some inspiration from there definitely.
mmazzarolo commentedon Oct 28, 2016
@felimartina I had the same issue but I thought it was just a mis-configuration on my side
felimartina commentedon Oct 28, 2016
@mmazzarolo will see if I grab some spare time these days and create a pull request...should be as simple as taking into account
notificationfield when sending the GCM in theGCM.jsfile. Let me know if you are experiencing some other issue we can see if we can add support for other options that can be sent to Android phones.These are the fields supported in the
gmc/fmcpayload:https://firebase.google.com/docs/cloud-messaging/http-server-ref#notification-payload-support
mmazzarolo commentedon Nov 2, 2016
@felimartina #41
jamlfy commentedon May 18, 2017
Well 'GCM', is oldddd.....
https://developers.google.com/cloud-messaging/