Fireship · @fireship

Ionic Native Push Notifications + Firebase Cloud Messaging

Uploaded March 12, 2018 · Length 9:38

Ionic Native Push Notifications + Firebase Cloud Messaging

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.

  1. 0:00

    [Music]

  2. 0:01

    one of the best ways to keep your users

  3. 0:04

    engaged on a native mobile app is to

  4. 0:06

    send push notifications today I'm going

  5. 0:08

    to show you how to set up firebase cloud

  6. 0:10

    messaging with ionic to do just that

  7. 0:12

    this video is going to be a lot of fun

  8. 0:15

    because it ties together many of the

  9. 0:16

    resources in the firebase platform

  10. 0:18

    including firestore cloud functions

  11. 0:20

    messaging and user aw by the end of this

  12. 0:23

    video you'll have a flexible

  13. 0:24

    notifications feature designed to work

  14. 0:26

    on both iOS and Android if you're new

  15. 0:29

    here make sure to LIKE and subscribe and

  16. 0:30

    you can find all of the source code at

  17. 0:32

    angular firebase comm and join the slack

  18. 0:34

    team so we can chat about your questions

  19. 0:36

    together the first thing I'll do is

  20. 0:38

    generate a brand new ionic app I'm using

  21. 0:40

    the tabs template but that part is

  22. 0:42

    completely optional then I'm going to go

  23. 0:44

    into the config dot XML file and make

  24. 0:47

    sure that we have a custom widget ID

  25. 0:48

    that we can use to register our project

  26. 0:51

    with firebase we're targeting native

  27. 0:53

    mobile apps on the App Store so what

  28. 0:55

    we're going to do is register our app on

  29. 0:57

    the firebase console for both iOS and

  30. 0:59

    Android for both platforms the only

  31. 1:02

    thing you have to do is enter your ID

  32. 1:03

    and click through the steps you don't

  33. 1:05

    need to download the SDK or anything

  34. 1:06

    like that when you finish the process

  35. 1:09

    you'll want to download your config file

  36. 1:11

    for both platforms and save it in the

  37. 1:13

    root of your ionic project for Android

  38. 1:15

    it's the Google services JSON file and

  39. 1:18

    for iOS it's the Google service -

  40. 1:20

    info.plist file now that our app is

  41. 1:23

    registered with firebase let's go ahead

  42. 1:25

    and add our dependencies first we have

  43. 1:27

    angularfire 2 which gives us access to

  44. 1:29

    the firestore database then we have the

  45. 1:32

    firebase cordova plugin for ionic which

  46. 1:34

    is going to give us access to native

  47. 1:36

    features for ios and android follow the

  48. 1:39

    official install instructions for both

  49. 1:41

    packages and then generate a custom

  50. 1:43

    ionic provider called

  51. 1:44

    FCM will use this provider to create a

  52. 1:47

    tightly integrated cross-platform

  53. 1:48

    notifications feature after following

  54. 1:51

    these steps you should have an app

  55. 1:53

    module that looks something like this

  56. 1:54

    we're importing an angular fire as well

  57. 1:57

    as firestorm then adding our firebase