//Catch Pre tags and apply highlighting

Android Push Notifications

Android notifications require a free Google Firebase account. This is where you get your API key and Sender ID used to send the notifications.

PLEASE NOTE: The google-services.json file is a different file to your Google Play Services API Key. The google-services.json file created in this doc is used within your app to connect to firebase and facilitate Android Push Notifications and is normally labelled google-services.json. The Google Play Services API Key is used on our build server to facilitate sending your completed app to Google Play and will usually take the form of a file name like "api-1234567890.json". Mixing up these two files will cause errors.

Step 1: Create a Firebase Project

Push Notifications require a Firebase Project. If you don't have one setup yet, click 'Add project' and follow the directions to setup your project.

If you already have an FCM project, skip to Step 2.

The first step is your project name, we usually suggest adding your app name.

For the second step, Google recommends adding Google Analytics to the project, but this is not required for setting up your push notifications.  You can deselect this if you like and then press Create Project.

Step 2: Adding Android push notifications to the Firebase project

We want to create an Android app and add it to this Firebase project.  From the first screen you encounter after entering your project, click on the Android icon.

In the next prompt, you will add your app's package name and give it a nickname.  The package name is also sometimes called the App ID or Bundle ID and is very important.

Once added, press the 'Register app' button (click here for the next step).

Important note on the package name.

The package name/Bundle ID is the unique identifier of the app in both the Google Play Store and Apple AppStore.  The structure needs to be in a reverse domain structure, so something like com.appname.app, and ideally, it is the same for both apps.  If this is the first version of your app, then you can find this ID in the Metadata section of your My AppPresser account

If it is not the first version of your app, then you can retrieve this ID from your Apple and Google developer account.

Downloading your google-services.json file.

After clicking 'Register app', you will be prompted to download the google-services.json file.

Do this and keep the file safe.  The press 'Next' > 'Next' > 'Continue to Console'.

Step 3: Getting your Project Settings

Next, click the gear icon at the top left, and go to Project Settings.

Under "Cloud Messaging API (Legacy)" click on the options (three dots on the right) and click "Manage API in Google Cloud Console".

This will open a new page, under Cloud Messaging press 'Enable'.

Return to your Firebase Console tab and refresh the page.  You will now see your Server Key and Sender ID needed for the Android Push Notifications to work:

Step 4: Adding the credentials to My AppPresser

After you have set up these values, you can copy them into the corresponding fields in your My AppPresser account.  Go to My AppPresser > your app > Features > Push Notifications and copy and paste the values in.

This is where you also need to upload your google-services.json file from earlier.

After these elements have been added, press 'Save' and your Android notifications should now be set up.

Android Notification Images

If you send a push notification through WordPress using the AppPush plugin, your post featured image will be shown in the notification. Make sure that your featured images are https, if you are not seeing images, try installing the SSL Insecure Content Fixer plugin.