Push Receiver

Push Receiver

The application allows you to receive and process push notifications

RU | EN

Push Receiver

Description

The application allows you to receive and process push notifications.
It can be used both as an example of the API interaction (notification receiving and displaying, launching the application from the background, and switching the UI mode) and for utilitarian purposes for testing and debugging the infrastructure.

When receiving a notification from the push-server, the first step is to check whether the PushReceiver is currently running. If it is not running, then it is running in the background (without GUI). Next, all notifications delivered to the device are received via the Push-daemon API and graphical representations are created for each of them via the Notifications API. If the application is running in the background and the notifications haven't been received for it for some time, then it shuts down. The graphical representation of notifications can either be displayed as a pop-up or placed in the notification curtain. Clicking on any of them will either launch the GUI application, if it has not been launched, or a graphical interface will be displayed for the current process.

Build status:

  1. example - pipeline status
  2. dev - pipeline status

Table of Contents

Compatibility

The application works correctly starting with Aurora OS 4.x.x and higher.

Branch info

Application versions conform to the branch naming convention

Install and Launch

Preparation for work

To configure the entire system, including the push-server and applications for sending and receiving notifications, you will need to perform several steps.

  • The first step is to send a letter to developer support at dev-support@omp.ru, where to tell the name of the application and request an archive with two configuration yaml files. In the future, you will need a file with such content (also, its name is shorter):

      push_notification_system:
        project_id: "..."
        push_public_address: "..."
        api_url: "..."
        client_id: "..."
        scopes: "..."
        audience: "..."
        token_url: "..."
        key_id: "..."
        private_key: "..."
  • The next step is to download the source code of the PushReceiver application. For this application to work with the push-server, you need to set the Application ID. There are two ways to do this: either in the pro project file assign the variable APP_ID you need (for example: APP_ID = orgexampleappname_fc7dfs3asd9fdgsa0), or after installing the application on the device, you need to set the Application ID received from the push-server to the applicationid file located in /usr/share/ru.auroraos.PushReceiver/. Further, provided that you have a valid Application ID in the file, when you first launch this application, it will be registered on the push-server and assigned a Registration ID, which will be needed in PushSender. You can copy it by clicking on the button to the right of the output field.

    Pay attention. This file is used for demonstration purposes only. For business applications, you need to get the Application ID from the application server.

  • To configure the service to work with a push server, see Features.

  • The next step is to download the sources of the PushSender application, build the application and install it on the device. On the first page, you must specify the Registration ID, which can be obtained from the PushReceiver (described in the previous paragraph). On the second page of the application, you can import a configuration yaml file through the top drop-down menu.

Features

  1. Aurora OS versions starting with 5.0.1.
    • Availability of Aurora Center on the device and its registration
  2. Aurora OS versions up to 5.0.1.
    • Configuring push service - set address, port and set the flag for crlValidation to false. To get the current settings, you can use the command devel-su gdbus call -y -d ru.omprussia.PushDaemon -o /ru/omprussia/PushDaemon -m ru.omprussia.PushDaemon.GetNetworkConfiguration. To set the parameters: devel-su gdbus call -y -d ru.omprussia.PushDaemon -o /ru/omprussia/PushDaemon -m ru.omprussia.PushDaemon.SetNetworkConfiguration “{‘address’:<‘push-server.ru’>, 'port':<8000>,'crlValidation':<false>"} (it is important that the host be protocol-free, e.g. https://),
    • Restart push-daemon using the command devel-su systemctl restart push-daemon.

Install

Install and run according to the build example instructions.

If the pushclient development package not found error occurs, you should check if the PushNotifications namespace is correctly connected. You can read about it in this article.
The application needs to have PushNotifications and Internet permissions to run. These permissions are set in the .desktop file.

Screenshots

Screenshots

Project Structure

The project has a standard C++ and QML based application structure for the Aurora OS.

  • ru.auroraos.PushReceiver.pro file describes the project structure for the qmake build system.
  • icons directory contains the application icons for different screen resolutions.
  • qml directory contains the QML source code and the UI resources.
    • components directory contains the custom QML components.
    • cover directory contains the application cover implementations.
    • icons directory contains the additional custom UI icons.
    • pages directory contains the application pages.
    • PushReceiver.qml file provides the application window implementation.
  • rpm directory contains the rpm-package build settings.
  • src directory contains the C++ source code.
    • application directory contains application interface.
    • model directory contains model notifications.
    • main.cpp file is the application entry point.
  • translations directory contains the UI translation files.
  • ru.auroraos.PushReceiver.desktop file defines the display and parameters for launching the application.

Terms of Use and Participation in Development

The project source code is provided under license, which allows its use in third-party applications.

The Participant Agreement governs the rights granted by the participants to the Open Mobile Platform Company.

Participant information is listed in the AUTHORS file.

The Code of Conduct is the current set of rules of the Open Mobile Platform Company, which communicates the expectations for interaction between community members when communicating and working on projects.