The OneSignal item provides remote push notifications for iOS & Android over the OneSignal service. More...

Import Statement: import VPlayPlugins 1.0





Detailed Description

Push Notifications are a great way to keep users engaged and inform users about updates in your app.

Property Documentation

appId : string

Set this property to your OneSignal app id of your custom app, found in your OneSignal Account.

googleProjectNumber : string

Set this property to the Google Project number of your Google Cloud Messaging project. See OneSignal Account for more information.

inAppAlertNotification : bool

By default this is false and notifications will not be shown when the user is in your app (the NotificationOpenedHandler is fired). If set to true notifications will be shown as native alert boxes if a notification is received when the user is in your app. The notificationReceived signal handler is then fired after the alert box gets closed.

logLevel : LogLevel

Set a custom log level for debugging output. Possible values are:

  • OneSignal.LogLevelNone
  • OneSignal.LogLevelFatal
  • OneSignal.LogLevelError
  • OneSignal.LogLevelWarn
  • OneSignal.LogLevelInfo
  • OneSignal.LogLevelDebug
  • OneSignal.LogLevelVerbose

The default log level is OneSignal.LogLevelNone.

notificationWhenActive : bool

This property defines how your app handles notifications on Android while your app is running in the foreground.

Set this property to true 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 false to instantly deliver the notification, triggering notificationReceived.

The default value for this property is false.

registrationId : string

Read-only propertyof the platform-specific registration id at Apple or Google. You can use this ID to send push notifications to specific devices but it's recommended to use the userId oder custom tags for that.

See also userId.

userId : string

Read-only property, providing the individual OneSignal user id after registering for push notifications. You can use this id to send push notifications to specific user devices.

Signal Documentation

notificationReceived(string message, variant additionalData, bool isActive)

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 message parameter contains the push notification's message.

The additionalData parameter is a map containing the payload of the received notification, which you can use for further actions (see Advanced Usages).

The isActive parameter is true if the app was in the foreground when the notification was received, otherwise false.

tagsReceived(variant tags)

Emitted after the user's currently set tags are received after requesting them with requestTags().

The tags parameter is a map containg the currently set user tags.

See also requestTags().

Method Documentation

void deleteTag(string key)

Call this method to delete a tag that was previously set on a user with sendTag() or sendTags(). Use deleteTags() if you need to delete more than one.

See also deleteTags().

void deleteTags(variant keys)

Call this method to delete multiple tags that were previously set on a user with sendTag() or sendTags(). Use deleteTag() if you need to delete only a single one.

See also deleteTag().

void requestTags()

Call this method to request the currently set tags for the user. The method is asynchronous and the tagsReceived signal handler is emitted as soon as all tags are loaded from the OneSignal backend.

See also tagsReceived.

void sendTag(string key, string value)

Call this method to tag a user with a specific key/value pair. You can use this tag later on to send targeted push notifications or create segments on

If you want to send more than one tag at a time you can also use sendTags().

See also sendTags.

void sendTags(variant tags)

Call this method to tag a user with multiple key/value pairs. You can use these tags later on to send targeted push notifications or create segments on

If you want to send only a single tag at a time you can also use sendTag().

See also sendTag.

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
create apps
create games
cross platform
native performance
3rd party services
game network
level editor
easiest to learn
biggest time saving
best support