Fireship · @fireship
Ionic Native Push Notifications + Firebase Cloud Messaging
Uploaded March 12, 2018 · Length 9:38
Summary
Ionic Native Push Notifications + Firebase Cloud Messaging setup tutorial for mobile apps
- ionic native push notifications
- firebase cloud messaging
- firebase push notifications
- ionic firebase integration
- firebase cloud functions
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
[Music]
- 0:01
one of the best ways to keep your users
- 0:04
engaged on a native mobile app is to
- 0:06
send push notifications today I'm going
- 0:08
to show you how to set up firebase cloud
- 0:10
messaging with ionic to do just that
- 0:12
this video is going to be a lot of fun
- 0:15
because it ties together many of the
- 0:16
resources in the firebase platform
- 0:18
including firestore cloud functions
- 0:20
messaging and user aw by the end of this
- 0:23
video you'll have a flexible
- 0:24
notifications feature designed to work
- 0:26
on both iOS and Android if you're new
- 0:29
here make sure to LIKE and subscribe and
- 0:30
you can find all of the source code at
- 0:32
angular firebase comm and join the slack
- 0:34
team so we can chat about your questions
- 0:36
together the first thing I'll do is
- 0:38
generate a brand new ionic app I'm using
- 0:40
the tabs template but that part is
- 0:42
completely optional then I'm going to go
- 0:44
into the config dot XML file and make
- 0:47
sure that we have a custom widget ID
- 0:48
that we can use to register our project
- 0:51
with firebase we're targeting native
- 0:53
mobile apps on the App Store so what
- 0:55
we're going to do is register our app on
- 0:57
the firebase console for both iOS and
- 0:59
Android for both platforms the only
- 1:02
thing you have to do is enter your ID
- 1:03
and click through the steps you don't
- 1:05
need to download the SDK or anything
- 1:06
like that when you finish the process
- 1:09
you'll want to download your config file
- 1:11
for both platforms and save it in the
- 1:13
root of your ionic project for Android
- 1:15
it's the Google services JSON file and
- 1:18
for iOS it's the Google service -
- 1:20
info.plist file now that our app is
- 1:23
registered with firebase let's go ahead
- 1:25
and add our dependencies first we have
- 1:27
angularfire 2 which gives us access to
- 1:29
the firestore database then we have the
- 1:32
firebase cordova plugin for ionic which
- 1:34
is going to give us access to native
- 1:36
features for ios and android follow the
- 1:39
official install instructions for both
- 1:41
packages and then generate a custom
- 1:43
ionic provider called
- 1:44
FCM will use this provider to create a
- 1:47
tightly integrated cross-platform
- 1:48
notifications feature after following
- 1:51
these steps you should have an app
- 1:53
module that looks something like this
- 1:54
we're importing an angular fire as well
- 1:57
as firestorm then adding our firebase


