title | parent |
---|---|
How to Set Up the Google Firebase Cloud Messaging Server |
push-notifications |
In order to send Android push notifications from this module, you need to set up a Firebase account with Firebase Cloud Messaging enabled. To register for Firebase Cloud Messaging and configure the service in the app, you need to perform the steps below.
There are two possible scenarios: you can create a new FCM project, or you can update your existing GCM project to FCM. Both scenarios are described below.
This how-to will teach you how to do the following:
- Create a new FCM project
- Update an existing GCM project to FCM
- Have a Firebase account
To prevent the degraded reliability of push notifications delivery, you should migrate existing GCM projects to Firebase Cloud Messaging and upgrade credentials if needed.
Open up the Firebase developers console and log in with your Google id.
In the Firebase console, select Import Google Project
. Select your GCM project from the list of existing projects, select a region, and click on Add Firebase
.
From here, continue with step 3, below.
Open up the Firebase developers console and log in with your Google id.
Click Create new project
and fill in the project name and region for your application. Then click Create
.
In the top left corner of the screen, click on the little cogwheel and select Project settings
.
On the new page, go to the Cloud Messaging
tab. Your Sender ID and Server key are listed here. We'll use these values to configure your app.
Open your Mendix application, log in as an Admin, and open the PushNotifications_Administration
page. In this page, navigate to the Configurations
tab. Select the configuration object and click Edit
if it already exists, or New
if it does not. For the DTAP mode
field, select the option that corresponds to your environment. Enter the sender id into the Sender id
field and the server key into the API Key
field.
Note that at this moment, multiple configuration objects are not supported; having more than one of these objects will lead to unpredictable behavior. This will be fixed in the near future.
Once the information has been entered, tick the Enabled
checkbox and press the Save and Restart
button. From now on your application will always connect to the FCM service on startup.
For more information on setting up your Google API please refer to this article: Firebase Cloud Messaging.