Notification Plugin

Schedule Time-Based Reminders

Remind your users of events or appointments in your calendar or to-do app. Schedule a countdown and inform your users even if your app is in the background.

Increase User Retention

Schedule a local push notification which brings your users back into your app or game after a certain time of inactivity.

Overview

In comparison to server-side push notifications local notifications are triggered at a certain point of time. Local notifications are scheduled from within your app logic and therefore do not require any server-side logic
for integration. Therefore they are ideally suited for applications with time-based behaviors, for example for apps like to-do list and calendar apps.

When scheduling a notification you specify a fire date at which the notification should be presented to the user. This can be either given as relative timestamp (Notification::timeInterval) or as an absolute UNIX timestamp (Notification::timestamp).

Note: iOS currently allows a maximum of 64 simultaneously scheduled notifications; the system keeps the soonest-firing notifications and discards all others.

If the app is currently in the foreground the signal is emitted immediately, there isn't however a sound played and no banner is displayed.

If the app is in the background the system plays a short notification sound and displays a banner with your provided message. If the user then taps the
notification the app goes to the foreground and the signal is emitted. The system also sets the provided number on the app icon on iOS or in the notification area on
Android, which gets cleared out again as soon as the user opens your app.

Use Cases

Local push notifications can be used for several use cases, here are some of them:

Timer-based Apps

A lot of apps notify users at a specific point of time about custom events or appointments. Such timer-based apps like to-do or calendar apps are ideally suited for local notification usage. As an example you can have a look
at the Dynamic Notifications example, which shows how to schedule notifications for a to-do app.

User Retention

You can bring your users back to your app after a certain amount of time of inactivity. As an example you can schedule an inactivity notification which gets triggered when a user does not open your app for more than 24
hours, like shown in the Static Notifications example below.

Notification Examples

Plugin Demo App

To try the plugin or see an integration example have a look at the V-Play Plugin Demo app.

Static Notifications

It's also possible to pre-define notifications as static QML items in your code and schedule them at given points of time. As an example we schedule an inactivity notification which gets triggered when a user does not open
your app for more than 24 hours:

Adding and Activating Plugins

How to Add a V-Play Plugin to your App or Game

When you create a new project, you can choose the Plugin Application template to get your own version of the V-Play Plugin Demo with the plugins you want to include. Open Qt Creator and choose
“File / New File or Project”, then select Plugin Application in the V-Play Apps section or Game with Plugins in the V-Play Games section to start the project wizard.

Then select the platforms you want to run your application on. The plugins are available for both iOS & Android. There is a fallback functionality in place on Desktop platforms so your project still works when you call
methods of the plugins. This allows you to do the main development on your PC, and for testing the plugin functionality you can run the project on iOS and Android.

After the Kit Selection, you can choose which of the plugins you’d like to add to your project:

Then complete the wizard, your project is now set up with all the correct plugin dependencies for Android & iOS automatically. This includes:

Setting up the .gradle file for Android.

Setting up the .plist file for iOS.

Setting up the .pro file to include the plugin libraries for iOS.

Note: Additional integration steps are still required for most plugins, for example to add the actual plugin libraries for iOS to your project. Please have a look at the integration steps described in the
documentation for each of the used plugins.

If you have an existing V-Play application, follow these steps to include a plugin to your app or game:

In Qt Creator, select “File / New File or Project” and choose either V-Play Games or V-Play Apps from Files and Classes. Then select V-Play Plugin and press Choose.

You can now select the plugin you want to add:

The plugin item, which contains the chosen plugin and a short usage example, is now added to your project. To use the item in your project, simply perform these steps:

Include the created item (use the name you entered in the template before) in your main.qml file.

Modify the .pro file & .plist file for iOS usage. See the iOS integration guide of the chosen plugin for more information.

Modify the the .gradle file for Android usage. See the Android integration guide of the chosen plugin for more information.

Note: If you have an existing Qt application, you can also add V-Play Plugins to your app! See here how to do this.

Activating Plugins with a License Key

You can test all plugins as soon as the required integration steps and plugin configuration are completed.

However, the plugins are only available as Trial Versions if they are not activated with a valid license. When you are using unlicensed plugins, a dialog is shown and a watermark overlays your application to notify you about
the testing state of the plugin.

All monetization plugins are free to use in all licenses, other plugins are only fully usable if you have purchased the Indie or Enterprise license. To activate plugins and enable
their full functionality it is required to create a license key. You can create such a key for your application using the license creation page.

This is how it works:

Choose the plugins you want to include in your license key:

Click on “Generate License Key” and set the app identifier & version code of your application. You can see that the AdMob plugin was enabled in this license key: