Skip to content
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

FCM compatibility #50

Open
kaiiserni opened this issue Aug 29, 2016 · 15 comments
Open

FCM compatibility #50

kaiiserni opened this issue Aug 29, 2016 · 15 comments

Comments

@kaiiserni
Copy link

Would it be easy to add compatibility to the new FCM which Google is pushing now?
https://developers.google.com/cloud-messaging/android/android-migrate-fcm

@morinel
Copy link
Owner

morinel commented Aug 29, 2016

Probably, maybe you could propose an update and send a pull request?

Thanks!

@kaiiserni
Copy link
Author

Sure, will try to do that later this month!

On Mon, Aug 29, 2016, 13:41 Jeroen van Vianen [email protected]
wrote:

Probably, maybe you could propose an update and send a pull request?

Thanks!


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#50 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAFXFh8Azj4GyaPUT3meSeZJi9ShYwamks5qksV3gaJpZM4JvYHS
.

@morinel
Copy link
Owner

morinel commented Aug 29, 2016

Thanks, such a change might warrant a 2.0 release.

@DaKaZ
Copy link

DaKaZ commented Nov 1, 2016

Any progress on the FCM updates? With google using language like:

GCM users are strongly recommended to upgrade to FCM

I am guessing GCM will be EOL soon

@cr0ybot
Copy link
Contributor

cr0ybot commented Apr 23, 2018

"As of April 10, 2018, Google has deprecated GCM. The GCM server and client APIs are deprecated and will be removed as soon as April 11, 2019."

Looks like we need to get going on this as soon as possible...

@cr0ybot
Copy link
Contributor

cr0ybot commented Jun 1, 2018

After doing some digging, it looks like this will be a non-trivial change to the code. Apparently GCMBaseIntentService and GCMBroadcastReceiver were deprecated long ago, so the switch to Firebase will not be a straight path. The GCM-FCM migration guide is expecting you to be using GcmListenerService.

@cr0ybot
Copy link
Contributor

cr0ybot commented Jun 8, 2018

Just wanted to post an update that I'm close; see my fork (firebase branch) here: https://github.com/cr0ybot/gcmpush/tree/firebase

It's a big change to the code, but it is so far mostly backward compatible with the current module's interface. The setup process is just a bit more involved.

However, I'm still not actually receiving notifications from Firebase... so more to come.

@morinel
Copy link
Owner

morinel commented Jun 8, 2018

@cr0ybot Thanks very much for your efforts so far.

@cr0ybot
Copy link
Contributor

cr0ybot commented Jun 12, 2018

Seems like the thing I was missing in order to get notification data was setting the SHA1 in the Firebase project settings. I've documented that process in the docs/README, and I think I'm ready to create a pull request.

@cr0ybot
Copy link
Contributor

cr0ybot commented Jun 13, 2018

Seems I was mistaken about needing that SHA1 set, I just removed them from the Firebase console and everything is working fine. I'm going to update the README/docs again and remove that bit.

@adegreiff
Copy link

hi @cr0ybot , thanks for your fcm branch. works good. when our app is closed i do not receive push messages, though. from debug i get this:

E NotificationService: No Channel found for pkg=..., channelId=null, id=1, tag=null, opPkg=..., callingUid=10318, userId=0, incomingUserId=0, notificationUid=10318, notification=Notification(channel=null pri=2 contentView=null vibrate=default sound=... defaults=0x6 flags=0x10 color=0x00000000 groupKey=... number=0 vis=PRIVATE semFlags=0x0 semPriority=0 semMissedCount=0)

in the notificationSettings i have included the new keys channelId and channelName but they seem to be ignored.

can you give me a hint for further debugging?

thanks
alexander

@cr0ybot
Copy link
Contributor

cr0ybot commented Jul 5, 2018

@adegreiff Sorry, I did not have an Android O device for testing this. It looks like I didn't do the channelId/channelName stuff properly. The notification building stuff is happening in FCMService::onMessageReceived().

I think that line 502-513 probably need to be moved up before line 437, and after notificationManager.createNotificationChannel(channel); should be a line like: builder.setChannelId(channelId);

Sorry I can't get to updating this right now, but if you get it working I'd be happy to accept a pull request to this pull request!

Stackoverflow reference: https://stackoverflow.com/a/45692202

@adegreiff
Copy link

@cr0ybot thanks so much for the hint. this did the trick. i have created a pull request. greetings from germany ;-)

@cr0ybot
Copy link
Contributor

cr0ybot commented Jul 6, 2018

@adegreiff Awesome! I've pulled your contributions into my branch.

@fahad86
Copy link

fahad86 commented Jul 25, 2018

@adegreiff does the "fcm_fallback_notification_channel_label" attribute work as intended? I've pulled cr0ybot/gcmpush(master) and I still can't get the notifications while the app is closed or in the background. When I open the app I can however see that calling getLastData() returns the data from the push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants