NotificationManager

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

Import Statement: import VPlayPlugins.notification 1.0
Inherits:

Item

Signals

Methods

Detailed Description

For more information also have a look at Notification Plugin.

Signal Documentation

onNotificationFired(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: {
     console.debug("Notification with id", notificationId, "fired")
   }

 }

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 V-Play", number: 1, timeInterval: 8 })

Please also have a look at the Dynamic Notifications example.

See also scheduleNotification and onNotificationFired.


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 Static Notifications example.

See also schedule and onNotificationFired.


Videos

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support