Merge PR #704: Fix push notifications ids with branding
This commit is contained in:
commit
abc1b9424f
@ -105,11 +105,7 @@ QString PushNotifications::service() const
|
||||
|
||||
QString PushNotifications::clientId() const
|
||||
{
|
||||
QString branding;
|
||||
#if defined BRANDING
|
||||
branding = QString("-%1").arg(BRANDING);
|
||||
#endif
|
||||
return PlatformHelper::instance()->deviceSerial() + "+io.guh.nymeaapp" + branding;
|
||||
return PlatformHelper::instance()->deviceSerial();
|
||||
}
|
||||
|
||||
QString PushNotifications::coreToken() const
|
||||
|
||||
@ -2,6 +2,11 @@ pragma Singleton
|
||||
import QtQuick 2.0
|
||||
|
||||
ConfigurationBase {
|
||||
systemName: "nymea"
|
||||
appName: "nymea:app"
|
||||
appId: "io.guh.nymeaapp"
|
||||
|
||||
connectionWizard: "/ui/connection/NewConnectionWizard.qml"
|
||||
|
||||
showCommunityLinks: true
|
||||
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
import QtQuick 2.0
|
||||
|
||||
Item {
|
||||
property string systemName: "nymea"
|
||||
property string appName: "nymea:app"
|
||||
property string systemName: ""
|
||||
property string appName: ""
|
||||
property string appId: ""
|
||||
|
||||
property string connectionWizard: "/ui/connection/NewConnectionWizard.qml"
|
||||
property string connectionWizard: ""
|
||||
|
||||
property bool showCommunityLinks: false
|
||||
}
|
||||
|
||||
@ -263,11 +263,13 @@ Item {
|
||||
return;
|
||||
}
|
||||
|
||||
var clientId = PushNotifications.clientId + "+" + Configuration.appId
|
||||
print("Updating push notifications")
|
||||
print("Own push service:", PushNotifications.service);
|
||||
print("Own client ID:", PushNotifications.clientId);
|
||||
print("Own client ID:", clientId);
|
||||
print("Current token:", PushNotifications.coreToken);
|
||||
|
||||
|
||||
for (var i = 0; i < engine.thingManager.things.count; i++) {
|
||||
var thing = engine.thingManager.things.get(i);
|
||||
if (thing.thingClass.id.toString().match(/\{?f0dd4c03-0aca-42cc-8f34-9902457b05de\}?/)) {
|
||||
@ -275,11 +277,11 @@ Item {
|
||||
var clientIdParam = thing.paramByName("clientId")
|
||||
var tokenParam = thing.paramByName("token")
|
||||
print("Found a push notification thing for client id:", clientIdParam.value)
|
||||
if (clientIdParam.value === PushNotifications.clientId) {
|
||||
if (clientIdParam.value === clientId) {
|
||||
if (tokenParam.value !== PushNotifications.coreToken) {
|
||||
var params = [
|
||||
{ "paramTypeId": serviceParam.paramTypeId, "value": PushNotifications.service },
|
||||
{ "paramTypeId": clientIdParam.paramTypeId, "value": PushNotifications.clientId },
|
||||
{ "paramTypeId": clientIdParam.paramTypeId, "value": clientId },
|
||||
{ "paramTypeId": tokenParam.paramTypeId, "value": PushNotifications.coreToken }
|
||||
];
|
||||
print("Reconfiguring PushNotifications for", thing.name)
|
||||
|
||||
@ -398,7 +398,7 @@ Page {
|
||||
return PushNotifications.coreToken;
|
||||
}
|
||||
if (paramType.id.toString().match(/\{?d76da367-64e3-4b7d-aa84-c96b3acfb65e\}?/)) {
|
||||
return PushNotifications.clientId;
|
||||
return PushNotifications.clientId + "+" + Configuration.appId;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user