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:
Table of Contents
- Compatibility
- Branch info
- Install and Launch
- Screenshots
- Project Structure
- Terms of Use and Participation in Development
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
yamlfiles. 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
PushReceiverapplication. For this application to work with the push-server, you need to set theApplication ID. There are two ways to do this: either in theproproject file assign the variableAPP_IDyou need (for example:APP_ID = orgexampleappname_fc7dfs3asd9fdgsa0), or after installing the application on the device, you need to set theApplication IDreceived from the push-server to theapplicationidfile located in/usr/share/ru.auroraos.PushReceiver/. Further, provided that you have a validApplication IDin the file, when you first launch this application, it will be registered on the push-server and assigned aRegistration ID, which will be needed inPushSender. 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 IDfrom 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
PushSenderapplication, build the application and install it on the device. On the first page, you must specify theRegistration ID, which can be obtained from thePushReceiver(described in the previous paragraph). On the second page of the application, you can import a configurationyamlfile through the top drop-down menu.
Features
- Aurora OS versions starting with 5.0.1.
- Availability of Aurora Center on the device and its registration
- 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-daemonusing the commanddevel-su systemctl restart push-daemon.
- Configuring push service - set address, port and set the flag for crlValidation to false. To get the current settings, you can use the command
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
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.
- ru.auroraos.PushReceiver.spec file is used by rpmbuild tool.
-
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.
