public class PushClient
extends java.lang.Object
The PushClient handles the activation of push notifications for the Gluon Mobile application. Upon enabling it, the device will be registered at the correct push notifications service for the platform where the device is running on. For Android devices, this is Google Cloud Messaging (GCM) or Firebase Cloud Messaging (FCM); for iOS devices, this is the Apple Push Notification service (APNs).
Note: The PushClient uses the PushNotificationsService
for handling the platform specific
details of push notifications. It also depends on the DeviceService
to get a handle to the unique
identifier of the device for the Gluon Mobile application. Therefor, make sure that both the push-notifications
plugin and the device plugin have been enabled in your Gluon Mobile application build configuration:
jfxmobile { downConfig { plugins = 'device', 'push-notifications', ... } }
Constructor and Description |
---|
PushClient() |
Modifier and Type | Method and Description |
---|---|
void |
enable(java.lang.String gcmSenderId)
Enable push notifications for the Gluon Mobile application.
|
public void enable(java.lang.String gcmSenderId)
gcmSenderId
is
the Sender ID of your GCM or FCM application. iOS devices don't need any specific parameters because they will
be setup correctly when building the iOS ipa application bundle.gcmSenderId
- the Sender ID of the Google Cloud Messaging application