pushnotifications: Add Qt6 support
parent
604ee1933f
commit
b99f9f5d90
|
|
@ -1,6 +1,6 @@
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
*
|
*
|
||||||
* Copyright 2013 - 2024, nymea GmbH
|
* Copyright 2013 - 2025, nymea GmbH
|
||||||
* Contact: contact@nymea.io
|
* Contact: contact@nymea.io
|
||||||
*
|
*
|
||||||
* This file is part of nymea.
|
* This file is part of nymea.
|
||||||
|
|
@ -31,12 +31,12 @@
|
||||||
#include "integrationpluginpushnotifications.h"
|
#include "integrationpluginpushnotifications.h"
|
||||||
#include "plugininfo.h"
|
#include "plugininfo.h"
|
||||||
|
|
||||||
#include "network/networkaccessmanager.h"
|
#include <network/networkaccessmanager.h>
|
||||||
#include "nymeasettings.h"
|
#include <nymeasettings.h>
|
||||||
|
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
|
|
||||||
IntegrationPluginPushNotifications::IntegrationPluginPushNotifications(QObject* parent)
|
IntegrationPluginPushNotifications::IntegrationPluginPushNotifications(QObject *parent)
|
||||||
: IntegrationPlugin{parent}
|
: IntegrationPlugin{parent}
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -202,7 +202,7 @@ void IntegrationPluginPushNotifications::executeAction(ThingActionInfo *info)
|
||||||
|
|
||||||
payload.insert("data", data);
|
payload.insert("data", data);
|
||||||
payload.insert("appid", "io.guh.nymeaapp_nymea-app");
|
payload.insert("appid", "io.guh.nymeaapp_nymea-app");
|
||||||
payload.insert("expire_on", QDateTime::currentDateTime().toUTC().addMSecs(1000 * 60 * 10).toString(Qt::ISODate));
|
payload.insert("expire_on", QDateTime::currentDateTimeUtc().addMSecs(1000 * 60 * 10).toString(Qt::ISODate));
|
||||||
payload.insert("token", token.toUtf8().trimmed());
|
payload.insert("token", token.toUtf8().trimmed());
|
||||||
} else if (pushService == "None") {
|
} else if (pushService == "None") {
|
||||||
// Nothing to do here... It's the clients responsibility to fetch it from nymea
|
// Nothing to do here... It's the clients responsibility to fetch it from nymea
|
||||||
|
|
@ -235,7 +235,7 @@ void IntegrationPluginPushNotifications::executeAction(ThingActionInfo *info)
|
||||||
QVariantMap replyMap = jsonDoc.toVariant().toMap();
|
QVariantMap replyMap = jsonDoc.toVariant().toMap();
|
||||||
int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
||||||
|
|
||||||
qDebug(dcPushNotifications) << status << qUtf8Printable(jsonDoc.toJson());
|
qCDebug(dcPushNotifications()) << status << qUtf8Printable(jsonDoc.toJson());
|
||||||
|
|
||||||
if (pushService == "UBPorts") {
|
if (pushService == "UBPorts") {
|
||||||
if (!replyMap.value("ok").toBool()) {
|
if (!replyMap.value("ok").toBool()) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
*
|
*
|
||||||
* Copyright 2013 - 2024, nymea GmbH
|
* Copyright 2013 - 2025, nymea GmbH
|
||||||
* Contact: contact@nymea.io
|
* Contact: contact@nymea.io
|
||||||
*
|
*
|
||||||
* This file is part of nymea.
|
* This file is part of nymea.
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
#ifndef INTEGRATIONPLUGINPUSHNOTIFICATIONS_H
|
#ifndef INTEGRATIONPLUGINPUSHNOTIFICATIONS_H
|
||||||
#define INTEGRATIONPLUGINPUSHNOTIFICATIONS_H
|
#define INTEGRATIONPLUGINPUSHNOTIFICATIONS_H
|
||||||
|
|
||||||
#include "integrations/integrationplugin.h"
|
#include <integrations/integrationplugin.h>
|
||||||
|
|
||||||
#include "googleoauth2.h"
|
#include "googleoauth2.h"
|
||||||
#include "extern-plugininfo.h"
|
#include "extern-plugininfo.h"
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
include(../plugins.pri)
|
include(../plugins.pri)
|
||||||
|
|
||||||
TARGET = $$qtLibraryTarget(nymea_integrationpluginpushnotifications)
|
QT *= network
|
||||||
|
|
||||||
QT+= network
|
|
||||||
|
|
||||||
# For RSA signing JWT
|
# For RSA signing JWT
|
||||||
PKGCONFIG += openssl
|
PKGCONFIG += openssl
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue