[MUSIC PLAYING]
JEN PERSON: [SIGHING] How do you feel?
JON MENSING: Loose.
JEN PERSON: Cool, let's get loose, all right.
Hey, all you Firebase developers.
I'm Jen Person.
Welcome to another episode of AskFirebase, the show
where we answer your burning Firebase questions.
Today, I am joined by Jon Mensing.
Specifically the reason I wanted to have you on today
is because recently we made a big announcement
about Google Cloud Messaging.
JON MENSING: Firebase Cloud Messaging--
which is the product I work on.
Firebase Cloud Messaging is the new version of Google Cloud
Messaging and does everything that Google Cloud Messaging
does and more.
JEN PERSON: Right.
JON MENSING: And so in order to focus more attention
and resources on Firebase Cloud Messaging,
we have deprecated Google Cloud Messaging.
And everyone needs to move over to FCM--
that's Firebase Cloud Messaging--
over the next year.
JEN PERSON: Certainly, once we made the announcement,
there were some pretty common questions that we saw.
And we're going to look at a few of those today.
JON MENSING: This next question comes to us from Timo.
It says, I was emailed regarding the GCM/FCM migration.
Not sure if this applies to my topic iOS notifications?
How do I tell?
JEN PERSON: Yeah, that's an awesome question
because I'm sure a lot of you out there got that email.
And you're thinking, I don't remember signing up for GCM.
Well, because GCM was so frequently used with Firebase
in the past, it would be enabled automatically when
setting up a Firebase project.
So that means that if you had a Firebase project,
you probably got this email about GCM.
It was much more challenging to try
to tell who's still actively sending messages with it.
Because you could have an app where
it could go a month without sending a message.
And we didn't want those people to be missed.
So how do you tell if this applies to you?
There are a couple of different things you want to look for.
So in your client app, if it's an iOS app,
take a look at your pod file.
Are you using the Google Cloud Messaging pod in your pod file?
Or are you using Firebase slash messaging?
If you're using Firebase slash messaging,
your client is not using GCM.
And you don't have to worry about it.
In terms of Android, if you're using
any of the GCM related gradle dependencies,
that would be using GCM.
If they say Firebase, again, you're
not using it in your Android client app.
And then if you take a look at your server sides,
if you're using the GCM endpoint,
then, yes, that's GCM.
But if it's FCM endpoint, again, you're
not using the Google Cloud Messaging.
JON MENSING: Yeah, so to summarize,
if you see Google Cloud Messaging or GCM somewhere,
odds are that's something that you're
going to want to look at a little bit
further and make sure that you're upgrading that
to the Firebase Cloud Messaging.
JEN PERSON: Right.
And if you're still not sure, check out the migration guides.
We'll link those below so you can see.
You can really compare side by side.
Is this some code that I have in my app?
Yes, no, do I need to change it?
You ready for another?
JON MENSING: I am.
Let's do it.
JEN PERSON: All right, let's do it.
So Sandra wants to know, is there
any way to clear or reset pending FCM messages
or to group pending messages on iOS like Android
can with the tag property?
Effectively, he's talking about collapsing messages.
If you send one notification, is it
going to replace the other one?
Or are they just going to get bombarded
with a whole bunch of them?
JON MENSING: Right, so there's no way
to clear or reset a message that goes over FCM to an iOS device.
But you can collapse messages together
so only the most recent message will be displayed.
And you can do that by using the APNS collapse ID.
I think that's the name of the parameter.
So check out the APNS documentation on Apple's site.
That's going to tell you everything you need
to know about how this works.
And all of those options work over FCM
because FCM delivers all of the APNS functionality
with a couple of benefits that we love to talk about.
JEN PERSON: So when it came to the GCM deprecation,
we compiled some frequently asked questions
that we have from our developers.
And maybe we should just talk about some of those
here as well.
JON MENSING: I think we should.
JEN PERSON: Cool.
One very important question is, what
is going to happen to my customers who
haven't updated to the latest version of the app yet?
Or are they going to stop receiving messages?
JON MENSING: Well, the short answer is no.
Anyone who has an existing GCM token
will still be reachable through the FCM APIs.
And those tokens, the GCM tokens and the FCM tokens,
are basically the same thing, and they're
mutually interchangeable.
So if the user has a GCM token, you can send to that token
just as easily as you can send to an FCM token.
No problem.
So in that upgrade window, as people are moving from GCM
to FCM, you'll still be able to reach your GCM users throughout
and indefinitely really.
JEN PERSON: Right.
Similarly, if you wanted to just update the client code for now
and then deal with the server later or vise versa,
because they're the same tokens, you
don't have to change everything at once.
JON MENSING: Yeah, that's important to understand.
And it's also nice to know that at no point will
you lose the ability to contact your users.
Because we all know that's really
the whole point of GCM and FCM.
JEN PERSON: Should I just put my GCM and FCM code
into the same app just to be absolutely sure
that that person is going to get a message?
Because I'm afraid that when I'm in the upgrade process
it might not work.
JON MENSING: Well, I think that's generally frowned upon.
JEN PERSON: Yes.
JON MENSING: I think it's a really bad idea actually.
And it might not seem like a bad idea.
But why you run into problems with that is the GCM SDK
is trying to manage tokens, requests tokens, from GCM.
Meanwhile, the FCM SDK is trying to do exactly the same thing.
It's trying to get tokens.
And because these tokens are interchangeable,
you can end up into a situation where
you think you've got the most recent token.
But in reality, you've got the wrong token.
Or maybe you've got two tokens for the same user.
And so when you try to send to that user,
you end up sending two messages by accident.
So there's a couple of different bad situations
that can arise if you try to put both of these
into the same app at the same time.
So you really just shouldn't do that.
JEN PERSON: Right.
So when it comes to the migration process,
you may not have to migrate the client and the server
at the same time.
But within a client, you're going
to want to do that one all at once.
You don't want to have mixes of GCM and FCM code in there.
JON MENSING: That's right.
JEN PERSON: Should we talk a little bit about privacy?
JON MENSING: Sure.
JEN PERSON: OK, one thing that's very important for us
to tell developers is when they have questions about, OK, what
kind of information, once I migrate,
what is Firebase collecting?
And what control do I have over that information?
JON MENSING: Well, all of the data
that's collected by Firebase is specified
in our terms of service as well as in our data
sharing documentation, which you can find online.
We'll post a link.
And you have all kinds of control over this.
JEN PERSON: So when it came to the announcement,
we talked about reaching out if you have any questions.
So make sure you're still doing that.
You can reach out to me on Twitter.
You can reach out to support.
And we'll link to that as well.
Just make sure you're letting us know
how your experience is going.
If you've already migrated, I want to hear how it went.
Thank you so much for watching another episode of AskFirebase.
And remember, if you have questions,
to tag them on social media with the hashtag #AskFirebase.
And who knows?
Maybe you'll see it on a future episode.
And be sure to subscribe to the Firebase channel.
So you can check out AskFirebase and other great content,
such as Firecast and MeetFirebase
and all sorts of cool, special things going on.
And thank you so much to Jon for coming on the show
and helping me answer people's questions.
JON MENSING: It was my pleasure.
JEN PERSON: All right, see you next time.
[MUSIC PLAYING]
JON MENSING: OK.
JEN PERSON: OK, yeah, yeah, I think we got good stuff.