JEN PERSON: How's it going, Firebase developers?
Good, good, sounds good.
JASON HERON: It's going great.
JEN PERSON: Good.
I was waiting for them to answer.
JASON HERON: Yeah.
JEN PERSON: If you understand me, clap twice.
JASON HERON: That's what I figured.
SPEAKER: Scene one, take one, mark.
JEN PERSON: Hey, all you Firebase developers,
welcome back to another episode of AskFirebase,
the show where we answer your burning Firebase questions.
I'm Jen Person, and today I am joined by Jason Heron.
JASON HERON: Howdy, folks.
JEN PERSON: Thanks so much for coming back on the show
and answering some in app messaging questions.
JASON HERON: Sure, yeah.
JEN PERSON: So are you ready to get started?
JASON HERON: Oh, you know it.
JEN PERSON: All right, let's dive in.
Yeah, I really did just do that.
Yeah, that just happened.
SPEAKER: That was so good!
JEN PERSON: Thank you.
Our next developer wants to know,
"I want to skip a message on the in app loading screen.
And I want Firebase in app to show
the message in the main activity,
but they don't want to make this."
So what can we tell this developer?
JASON HERON: So again, this is like a great use
of contextual triggers.
So this is already totally supported
in in app messaging right now.
So essentially, there are kind of
like two different integrations for in app messaging.
One, there's that codeless integration,
where you just include RSDK in your dependencies.
And then, if you want--
when the app opens, a message will
be displayed, if it's kind of targeted
and designed to be displayed for those users.
But if you want more control and you wanted to, maybe,
show when a loading bar is done, or not show during a loading
bar, or show when a certain piece of code
is being executed, well, then you
would use contextual triggers for that.
So again, you hook into Firebase Analytics events.
And there's no additional configuration needed.
You don't need to tell us that you're
using Firebase Analytics.
We just read the local analytics stream
and whenever an event triggers.
So let's say you want to trigger an event like loading done.
And then, boom, we can show a message right there.
And in the case where you want to show
a message in your main activity, you
could trigger a message like-- or trigger an analytics event
like main activity.
And then we could show a message based on that.
JEN PERSON: I actually had a little bit of a question myself
about triggering based on analytics events.
JASON HERON: Oh, yeah.
JEN PERSON: Now, if have an analytics event that's
happening multiple times in your application,
is the message always going to come up?
JASON HERON: No.
So we have a few different ways you can configure that.
So by default, a message can show a maximum of once per day.
And you can change that to be less frequent,
but you can't change it to be more frequent.
So if you have an event, like the user wins a level,
you can only really show a message on that once per day.
Now, if you, for example, want to show a message,
you know, every time a user gets to the next level,
I mean, there's a question of whether
or not that is exactly the right case
for our particular campaign model.
But in theory, let's say you had two or three different levels,
you could have a different analytics event.
And you could trigger based on those different events.
So there's kind of a way to get around that.
But in general, with in app messaging,
we're really trying to protect the users to not
be able to really be spammed by in app messaging.
So for example, if someone configures a message
to open every time the app opens,
it's really not going to be super great for the users.
Every single time the app opens, they
have to go through this message.
So there's kind of some built in limitations there.
JEN PERSON: Right, yeah, that makes sense.
Because Firebase in app messaging
is more about nudging your users toward a specific action,
rather than just regularly displaying,
kind of, things that you want to tell them, in general.
So it's best to have it less frequently
for it to have more impact, and like you said, not be annoying.
I've definitely had that experience in apps
before, where you're just like, I want to get to the thing
that I came here to do.
But there's always something popping up.
JASON HERON: Yeah, we're definitely about,
like, trying to engage users based on the context of the app
and really try to provide additional value.
So yeah.
JEN PERSON: Thank you for answering my question.
I appreciate that.
Our next developer asks, "Is there
a way to go target my campaign in Firebase in app messaging?
So if I create a campaign for only my US users,
can I specify that in my console?"
JASON HERON: Yes, this is a feature we just added recently.
You can totally do that in the console today.
Thanks to my co-worker, Paccar, great work, huge effort,
we got that accomplished.
So yeah, you can totally do this.
JEN PERSON: Yeah, and this sort of calls out to me
that if there is some sort of specific targeting use
case that you think would be useful in your app,
remember to file a feature request.
And the more information you can give about how you would use it
and why that would be useful, we really listen to that feedback,
and we appreciate it.
JASON HERON: Yep.
JEN PERSON: I like this next question,
which I got from our YouTube comments on the in app
messaging animated intro.
JASON HERON: Gotta love Youtube comments.
JEN PERSON: Yeah, yeah, and this one gets right to the point.
"Paid?
Or free like cloud messaging?"
JASON HERON: Yeah, so what you see right now in the Firebase
console for in app messaging has no intention of really becoming
a paid product.
I mean, obviously, I can't talk about, like, some future plan
that I have no idea about.
But being an engineer on in app messaging
and knowing what I know, yeah, we
have no intention of making that a paid product.
I think that the only thing that could potentially
become a paid product in the future
is something like paid by proxy.
So in the case where maybe we allow
you to somehow invoke a Cloud Function
through in app messaging or do some other feature
that kind of adds compute.
Then potentially that could be something
that would be kind of charged as it was invoked.
But for the core product that you
see right now in the console, that's going to remain free.
JEN PERSON: So our developers can
use in app messaging as much as they want with no cost.
JASON HERON: Absolutely.
All right, Jen, I've got a question from the internet.
"Hi, Jen!"
JEN PERSON: Hi.
JASON HERON: "I think my Google skills are failing me.
I want to insert data into Firestore
from a Cloud Function.
Is there any documentation you can point me to?
Everything I have found is for Firestore events
triggering Cloud Functions, which I don't want."
JEN PERSON: This is a great question.
And I was really excited when I saw it,
because I got to talk about one of my favorite things.
It looks like what you are looking for is some server side
way to interact with Cloud Firestore or other Fire based
features.
In which case, what you want is the Admin SDK.
And I will link to the documentation for that below.
But if you've seen any of my previous videos,
you know that I'm really excited about using the Admin SDK
right now.
We have it available in Node.js, Python, Go, Java,
we recently added PHP.
So there are a lot of options to access Firebase features
from your server or serverless solution using
the language of your choice.
And that's what you want to think of when you want
to access Firebase server side.
You're basically the admin of that.
Hence the name Admin SDK.
I kind of wish we had called it Server SDK or something.
Because as he says, it's a little harder
to search on Google to find the Admin SDK.
So yeah, I'll also link to some examples of using the Admin SDK
inside of a Cloud Function.
So you can see what that looks like.
We have some great samples.
JASON HERON: Nice.
JEN PERSON: Well, that was a lot of questions, yeah?
JASON HERON: I know.
I'm like, OK, great, we accomplished it.
JEN PERSON: They're coming at you rapid fire.
JASON HERON: Yeah, I'm like, we win.
JEN PERSON: Thanks so much for coming on the show, Jason.
I really appreciate you making the trip down
from San Francisco to answer some questions
about in app messaging.
JASON HERON: Yeah, happy to be here.
JEN PERSON: And thank all of you for your questions.
We really couldn't make the show without you.
So if you have a question about Firebase,
be sure to tag it with the hashtag, #AskFirebase.
And who knows, maybe we'll be answering it here
on a future episode.
And if you like the content you see
here, be sure to subscribe to the Firebase YouTube channel
so you can see all of the different programming
that we have here.
Thanks so much for watching, and I'll
see you on a future episode.
Then there's some music.
JASON HERON: [BASE SOUNDS WITH MOUTH]
JEN PERSON: [MUSIC SOUND EFFECTS] Yeah.
JASON HERON: Yeah.