Warning: As GCM was deprecated (April 10, 2018) and removed (April 11, 2019) by Google, Notification Provider is the only method available to integrate push notifications in a GeneXus-generated Android application.
This is an overview of push notifications for an Android Application. If you need general information on how to use push notifications in native mobile applications, see Push Notifications in Native Mobile Applications.
Note: This guide shows how to integrate push notifications using OneSignal. GeneXus does not support or maintain the configuration of this external service. Screenshots, parameters, UI labels, and/or configuration steps in OneSignal may change over time.
Before configuring anything in GeneXus, you must have completed the OneSignal setup process.
This includes:
- Accessing the Firebase Console with a Google Account, going to Project Settings > Service Accounts, and clicking on the Generate new private key button. This Private Key is uploaded to OneSignal during platform configuration.
- Uploading that Private Key in OneSignal during platform configuration.
- Obtaining the following values from OneSignal:
- App ID
- API Authentication Key (This is the value you must enter in GeneXus in the REST API Key property).
For more details, read: HowTo: Register an application to use OneSignal services.
To use push notifications in an Android application generated with GeneXus, configure the following properties:
In the Preferences window, at the Backend Generator level, configure:
For more details on how to obtain these values, read HowTo: Register an application to use OneSignal services.
From now on, every time you execute a GeneXus application that has push notifications enabled in a device, the Devices Registration Service is executed to register and store the device information to be used later when sending messages (push notifications) to that device.
Notifications are sent as shown in this Sender example.
And that’s it. The messages sent will be shown as notifications in the Android device:
