The GoogleCloudMessaging item provides remote push notifications for iOS & Android with the Google Cloud Messaging platform. More...
Import Statement: | import Felgo 4.0 |
Inherits: |
Push Notifications are a great way to keep users engaged and inform users about updates in your app.
backgroundFetchEnabled : bool |
Allows to enable or disable push-triggered background downloads. This can be used e.g. to download content updates while the app is not running. The default value for this property is false
.
You can use a property binding to an enabled switch in your user interface to allow users to unsubscribe from background downloads.
Note: If you set enabled to false, background downloads are disabled as well.
See also backgroundFetchUrl and backgroundFetchStackSize.
backgroundFetchStackSize : int |
Specifies the maximum number of background fetch downloads which should be stored until the next app start. The default value for this property is 1
.
Note: If this property is set to 0
, background fetches are disabled.
See also backgroundFetchUrl and backgroundFetchEnabled.
backgroundFetchUrl : string |
Specifies the URL from which the new background content should be downloaded.
The download URL supports dynamic URL parameters, set from within the push notification. You can find more information in the section Using URL Parameters.
See also backgroundFetchEnabled and backgroundFetchStackSize.
enabled : bool |
Allows to enable or disable all push notification channels on the specific device.
Disabling push notifications results in unsubscribing from all channels. Note that the device still receives broadcast push notifications (notification which are not targeted for a specific channel or group).
You can use a property binding to an enabled switch in your user interface to allow users to unsubscribe from all notifications.
processForegroundNotifications : bool |
This property defines how your app handles notifications on Android while your app is running in the foreground.
Set this property to false
to queue a new notification in the Android notification bar. The notification is delivered as soon as the user taps the notification (notificationReceived is called).
Set this property to true
to instantly deliver the notification, triggering notificationReceived.
The default value for this property is true
.
The topics property contains a list of topics the user is currently subscribed to. For more information on how to use topics have a look at Basic Usage.
Each topic name must start with a letter and contain only letters, numbers, dashes, and underscores.
See also channels.
Emitted as soon as new content from a background fetch fetch triggered by a push notification is available. If the app is running, the signal is emitted as soon as the background download finished. If the app is in background or not running at all, this signal is emitted when the user opens the app again.
The content is a list of strings that were downloaded in the background.
Content can contain up to as many items as specified in backgroundFetchStackSize.
Each of the strings is preceded by the UNIX timestamp (in milliseconds) it was downloaded, followed by a colon, like in the following sample:
<timestamp>:{ "count": 3 }
Note: The corresponding handler is onBackgroundFetchAvailable
.
notificationReceived(variant data) |
Emitted after a notification was received, either when the app is in the foreground or when a user opens the app by tapping on a notification in the platform-specific notification center.
The data parameter is a map containing the payload of the received notification, which you can use for further actions (see Advanced Usages).
Note: The corresponding handler is onNotificationReceived
.