Skip to content

Enabling Firebase Service (Push Notification and Analytics)

Enable Firebase Service on Android

You will need google-services.json for the Firebase Cloud Messaging (FCM) configuration on Android. Please follow the steps to set up notification on Android.

Steps

  1. Create an Android application on FCM console.

  1. Fill in the information of your Android app.

  1. Download google-services.json.

  1. Click "Next" to skip the steps for native Android app below.

  2. Move google-service.json to Android app module root directory

  3. Add Firebase SDK

  4. Stay at the 4th step on the FCM Setting page.

Note: This step is to verify whether your application registered FCM from the client app or not. You will need to build an app to verify it.

  1. Set up notification in your Ionic project to proceed with the verification process.

  2. Add Android platform

ionic cordova platform add android
  • Copy google-services.json to platforms/android/app
  • Build and run your Android App on a real device
ionic cordova run android --device.
  1. Open your App and check for the installation verification status shown on FCM setting page

Note:If you can't pass the installation verification, please see the readme of the plugin we use to find out for more information.

Enable Firebase Service on iOS

You will need .p8 APNs key for the FCM authorization and GoogleService-Info.plist for the FCM configuration to set up notification on iOS.

Generate .p8 File of APNs Key

Please follow the "Create the authentication key" section of the FCM instruction to generate a .p8 key file containing your APNs Auth Key.

Set Up APNs Key on FCM Console

Please follow the steps to set up APNs key on the FCM console.

Steps

  1. Go to FCM project settings.

  1. Go to Cloud Messaging tab.

  1. Go to iOS app configuration section and upload your APNs authorization key.

Set Up Notification on iOS

Follow these steps to prepare GoogleService-Info.plist for the FCM configuration on iOS.

Steps

  1. Create an iOS application on FCM console.

  1. Fill in the information of your iOS app.

  1. Download GoogleService-Info.plist.

  1. Click "Next" to skip the steps for native iOS app below.

  2. Move GoogleService-Info.plist to Xcode project.

  3. Install CocoaPods and run pod setup to initialize it. You can skip the steps in the setting page.

  4. Click "Next" to skip the steps for native iOS app below.

  5. Add initialization code

  6. Stay at the 5th step on the FCM Setting page.

Note: This step is to verify whether your application registered FCM from the client app or not. You will need to build an app to verify it.

  1. Set up notification in your Ionic project to proceed with the verification process.

  2. Add iOS platform

ionic cordova platform add ios
  • Copy GoogleService-Info.plist to Ionic project root folder.
  • Add the resource-file tag to the ios platform tag in config.xml.
<platform name="ios">
    <resource-file src="GoogleService-Info.plist" />
platform>
  • Build and run your iOS App on a real device.
ionic cordova run ios --device
  1. Open your App and check for the installation verification status shown on the FCM setting page.

Note:If you can't pass the installation verification, please see the readme of the plugin we use to find out for more information.

Have more questions? Submit a request