Orchestration SDKs

Step 4. Configuring Android apps for push notifications

PingOne Advanced Identity Cloud PingAM Android

In this step, you configure your application project to use Firebase Cloud Messaging.

  1. In Android Studio, open your project and switch to the Project view.

  2. Copy the google-services.json file that you downloaded from the Firebase console into the app-level root directory of your project:

    android studio google services json en
    Figure 1. Adding the google-services.json to the app root in Android Studio.
  3. To make the file available to the app, add the Google services Gradle plugin (com.google.gms.google-services) as a dependency to your project.

    1. In your root-level Gradle file:

      • Kotlin

      • Groovy

      build.gradle.kts
      plugins {
          // ...
      
          // Add the dependency for the Google services Gradle plugin
          id("com.google.gms.google-services") version "4.4.2" apply false
      }
      build.gradle
      plugins {
          // ...
      
          // Add the dependency for the Google services Gradle plugin
          id 'com.google.gms.google-services' version '4.4.2' apply false
      }
    2. In your app-level Gradle file:

      • Kotlin

      • Groovy

      build.gradle.kts
      plugins {
          // ...
      
          // Add the Google services Gradle plugin
          id("com.google.gms.google-services")
      }
      build.gradle
      plugins {
          // ...
      
          // Add the Google services Gradle plugin
          id 'com.google.gms.google-services'
      }
  4. Switch to the Android view in Android Studio, and add the android.permission.POST_NOTIFICATIONS permission inside the <manifest> element in the AndroidManifest.xml file:

    Adding post notification permission to AndroidManifest.xml
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />