nymea-plugins/pushnotifications
Simon Stürz b99f9f5d90 pushnotifications: Add Qt6 support 2025-08-14 10:26:19 +02:00
..
translations PushNotifications: Allow adding custom data to push notifications 2022-08-02 12:38:50 +02:00
README.md PushNotifications: Allow adding custom data to push notifications 2022-08-02 12:38:50 +02:00
googleoauth2.cpp PushNotifications: Update firebase messaging to API V1 2024-07-17 16:40:11 +02:00
googleoauth2.h PushNotifications: Update firebase messaging to API V1 2024-07-17 16:40:11 +02:00
integrationpluginpushnotifications.cpp pushnotifications: Add Qt6 support 2025-08-14 10:26:19 +02:00
integrationpluginpushnotifications.h pushnotifications: Add Qt6 support 2025-08-14 10:26:19 +02:00
integrationpluginpushnotifications.json PhsNotifications: Add support for updating already delivered notifications 2023-02-25 22:06:16 +01:00
pushnotifications.pro pushnotifications: Add Qt6 support 2025-08-14 10:26:19 +02:00

README.md

Push Notifications

This plugin allows to send push notifications to mobile devices.

Supported platforms

  • Android (using Firebase Cloud Messaging)
  • iOS (using Firebase Cloud Messaging)
  • Ubuntu/UBPorts Phone

Requirements

A push notification device token is required during setup. For Android and iOS, a Firebase token is required. Note that native iOS push tokens are not supported as the Apple Push Notification Service (APNs) does not allow sending messages in such a distributed manner, however, Firebase is available for iOS too. On Ubuntu, the UBPorts push services are used.

More

Setup

During setup, the token, the push service system and a client id needs to be provided. The token is normally obtained by the operating system. The push service should be selected from FB-GCM, FB-APNs or UBPorts. The client id must a unique per client and as persistent as possible.

Note: Even when using APNs, the token must be obtained using the Firebase SDK as plain APNs does not support sending push notifications from a distributed setup like nymea, but always requires a centralized server on the internet handling all messages.

As it is impossible for an end user to obtain this token, a client app should prefill all the parameters when setting up a push notification thing. Normally, push tokens expire after a while (for instance when the user clears app data, when the operating system decides to cycle tokens etc). In this case, the client app should reconfigure its own push notification thing, updating the token with the new one. The client ID parameter schould be used to find the appropriate thing to reconfigure.

Extra data

When sending a push notification, additional data can be passed which will delivered to the client (e.g. nymea:app).

nymea:app currently supports the following extra data:

  • open=view: Open a particular view in the app. This can be a main view or a thing id.
  • execute=action&thingId=&actionParams=

Examples:

Open the Dashboard view:

open=dashboard

Open a particular thing by its ID:

open=5634307c-8569-4365-a78a-45e7e97966cb

Turn on a light:

execute=power&thingId=5634307c-8569-4365-a78a-45e7e97966cb&actionParams="{\"power\":true}"