/**
 Android
 Push Notifications  */

Go back to Android Getting Started Guide

Push Notifications with FCM

Integrate FCM Push Notifications in your App project

  1. First, add rules to your root-level build.gradle file, to include the google-services plugin:
    buildscript {
        // ...
        dependencies {
            // ...
            classpath 'com.google.gms:google-services:3.0.0'
        }
    }
    
  2. Then, in your module Gradle file (usually the app/build.gradle), add the apply plugin line at the bottom of the file to enable the Gradle plugin:
    apply plugin: 'com.android.application'
    
    android {
      // ...
    }
    
    dependencies {
      // ...
      compile 'com.google.firebase:firebase-core:9.6.1'
    }
    
    // ADD THIS AT THE BOTTOM
    apply plugin: 'com.google.gms.google-services'
    
  3. Add the below dependency to your app's build.gradle file:
    dependencies {
        compile "com.google.firebase:firebase-messaging:9.6.1"
    }
    
  4. In the Android.Manifest file, add the below between the Application Tag:
    <activity 
        android:name="com.pyze.android.push.PyzePushTrackingActivity" android:exported="true"/>
    
            <service
                android:name="com.pyze.android.push.fcm.FcmPushListenerService">
                <intent-filter>
                    <action android:name="com.google.firebase.MESSAGING_EVENT" />
                </intent-filter>
            </service>
            <service
                android:name="com.pyze.android.push.fcm.FcmInstanceIDListenerService"
                android:exported="false">
                <intent-filter>
                    <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
                </intent-filter>
            </service>
    
  5. Get the configuration file from Google and place it under your app/ folder in your android studio project. Open this link for more info: https://support.google.com/firebase/answer/7015592

Go back to React Native Developer Center.


About Pyze

Pyze Growth Intelligence® is a transformative SaaS platform that enables mobile and web app businesses to automate engagement, retention and growth of their users. Signup at Pyze, install and initialize the Pyze SDK and watch your app grow.