Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

NotificationManager

The NotificationManager item allows scheduling native local push notifications on iOS & Android. More...

Import Statement: import Felgo 4.0
Inherits:

PluginItem

Properties

Signals

Methods

Detailed Description

For more information also have a look at Notification Plugin.

Property Documentation

[since Felgo 3.7.1] channelId : string

A unique identifier for the notification channel. Android uses this to group app notifications.

If not set, it uses a default ID based on the application's bundle identifier.

This property was introduced in Felgo 3.7.1.

See also channelName.


[since Felgo 3.7.1] channelName : string

A name for the notification channel. Android uses this to group app notifications.

If not set, it uses a default English name.

This property was introduced in Felgo 3.7.1.

See also channelId.


Signal Documentation

notificationFired(string notificationId)

This handler is called whenever a notification was fired. The provided notificationId parameter describes the fired notification. You can use the parameter to decide further actions in your app, e.g. to display a pop-up or navigate to another screen.

Example:

 NotificationManager {

   onNotificationFired: notificationId => {
     console.debug("Notification with id", notificationId, "fired")
   }

 }

Note: The corresponding handler is onNotificationFired.

See also schedule and scheduleNotification.


Method Documentation

void cancelAllNotifications()

Call this function to cancel all currently scheduled notifications for your app.

See also cancelNotification.


void cancelNotification(string notificationId)

Call this method to cancel the scheduled notification identified by the given notificationId. The notificationId can either be retrieved from a statically created Notification item or cached from a dynamically scheduled one.

See also cancelAllNotifications.


string schedule(variant params)

Dynamically schedules a local notification for delivery at a given point of time. The params map parameter expects the keys as in the Notification item. The return value is the notification's notificationId which is either set directly in the notification or randomly created during scheduling.

Example:

 // Trigger notification in 8 seconds
 var notificationId = notificationManager.schedule({ message: "Hi Felgo", number: 1, timeInterval: 8 })

Please also have a look at the Notification Plugin#Example Usage.

See also scheduleNotification and notificationFired.


string scheduleNotification(Notification notification)

Schedules a given Notification item for delivery at a given point of time. The return value is the notification's notificationId which is either set directly in the notification or randomly created during scheduling.

Example:

 Notification {
   id: staticNotification

   notificationId: "static_notification"
   message: "I'm statically defined in the app"
   timeInterval: 10

   Component.onCompleted: {
     // Trigger notification in 10 seconds
     notificationManager.scheduleNotification(staticNotification)
   }
 }

Please also have a look at the Notification Plugin#Example Usage.

See also schedule and notificationFired.


Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded