Android push notifications (legacy)

Configure push notifications within Xtremepush and your app

❗️

Authentication change

Please see the updated instructions for Android push notifications.

Firebase has migrated to a new HTTP v1 API. Effective June 2024, Firebase will stop supporting the legacy FCM APIs for HTTP and XMPP. From this date on the the Firebase API will only support the OAuth2 token-based authentication.

Failure to comply with the API key (token-based) authentication by June 21st 2024 will cause push messages to stop working as a result of login failures, so we recommend making this change as soon as possible.

Instructions below are provided only as a record of legacy instructions.

To send push notifications on Android you need to have a Firebase Cloud Messaging Server key and Sender ID. Follow these steps to generate these and enable push notifications in both the Xtremepush platform and your Android app.

Get configuration values

  1. Go to the Google Firebase console at (https://console.firebase.google.com/)
  2. Create a new project if you currently have none.
  3. Click the Settings icon and select Project Settings.

  1. If not already added, add your Android app to the project, and download the google-services.json config file associated with that app.

  1. Go to Settings > Cloud Messaging where you will find the Server key and Sender ID.

Configure Xtremepush

  1. In Xtremepush, go to Settings > Apps & sites > click on the matching Android app > Push Settings

  2. Copy the Sender ID and Server key into the appropriate fields and press Save.

❗️

Any subscribed users are opted-in against your Sender ID on Firebase. If you change the Sender ID of an existing integration you will lose your current subscribers.

Add to app

  1. Add these libraries to your project-level build.gradle file:
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.google.gms:google-services:4.3.3'
  1. Add the following to your module-level build.gradle file:
apply plugin: 'com.google.gms.google-services'
  1. Finally, add the google-services.json you downloaded to your project/app folder: