Class AndroidPushNotificationsService
java.lang.Object
com.gluonhq.attach.pushnotifications.impl.AndroidPushNotificationsService
- All Implemented Interfaces:
PushNotificationsService
iOS implementation of PushNotificationsService.
-
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.ReadOnlyStringPropertyThe unique registration token that can be passed to the server, so the app can receive push notifications -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidregister()Register the app for receiving push notifications.voidDeprecated.voidRemoves all delivered notifications that haven't been read yet.voidsetAppIconBadgeNumber(int badgeNumber) On iOS, set the number showing as the badge of the app icon on the Home screen.javafx.beans.property.ReadOnlyStringPropertyThe unique registration token that can be passed to the server, so the app can receive push notifications
-
Property Details
-
token
public javafx.beans.property.ReadOnlyStringProperty tokenProperty- Specified by:
tokenPropertyin interfacePushNotificationsService- Returns:
- a ReadOnlyStringProperty with a unique token
-
-
Constructor Details
-
AndroidPushNotificationsService
public AndroidPushNotificationsService()
-
-
Method Details
-
tokenProperty
public javafx.beans.property.ReadOnlyStringProperty tokenProperty()Description copied from interface:PushNotificationsServiceThe unique registration token that can be passed to the server, so the app can receive push notifications- Specified by:
tokenPropertyin interfacePushNotificationsService- Returns:
- a ReadOnlyStringProperty with a unique token
-
register
Deprecated.Description copied from interface:PushNotificationsServiceRegister the app for receiving push notifications. On iOS this will trigger a confirmation dialog that must be accepted by the user. For Android, you need to pass in the authorizedEntity value that matches the Sender ID of your Google Cloud Messaging or Firebase Cloud Messaging application.- Specified by:
registerin interfacePushNotificationsService- Parameters:
authorizedEntity- a string that matches the Sender ID of a GCM or FCM application
-
register
public void register()Description copied from interface:PushNotificationsServiceRegister the app for receiving push notifications. On iOS this will trigger a confirmation dialog that must be accepted by the user.- Specified by:
registerin interfacePushNotificationsService
-
setAppIconBadgeNumber
public void setAppIconBadgeNumber(int badgeNumber) Description copied from interface:PushNotificationsServiceOn iOS, set the number showing as the badge of the app icon on the Home screen. Set number to 0 to hide the badge number. On Android, override the default number of notifications displayed in the popup that can be shown from the app icon. Set 0 to use the default notification counter. Important notes: - there is no track of the current badge number that the icon might have - when the push notification is read, there is no automatic handling of decreasing the badge number So it is up to the developer to handle this number properly.- Specified by:
setAppIconBadgeNumberin interfacePushNotificationsService- Parameters:
badgeNumber- the number that will show up in the app icon badge, or 0 to hide it. The default value is 0.
-
removeAllNotifications
public void removeAllNotifications()Description copied from interface:PushNotificationsServiceRemoves all delivered notifications that haven't been read yet. This can be used to remove pending notifications, when the user doesn't tap on the notification to open the app, but directly opens it. It also resets the badge number.- Specified by:
removeAllNotificationsin interfacePushNotificationsService
-