fix push registering on iOS, improve android push notification icons

pull/42/head
Michael Zanetti 2018-09-19 17:18:17 +02:00
parent b2d61f2f62
commit 45ddbd3320
8 changed files with 34 additions and 23 deletions

View File

@ -64,6 +64,7 @@ QString PushNotifications::token() const
void PushNotifications::setAPNSRegistrationToken(const QString &apnsRegistrationToken)
{
qDebug() << "Received APNS push notification token:" << apnsRegistrationToken;
m_token = apnsRegistrationToken;
emit tokenChanged();
}

View File

@ -61,6 +61,13 @@ ApplicationWindow {
setupPushNotifications(false)
}
}
Connections {
target: PushNotifications
onTokenChanged: {
setupPushNotifications();
}
}
Connections {
target: Engine.awsClient
onIsLoggedInChanged: {
@ -133,14 +140,22 @@ ApplicationWindow {
askForPermissions = true;
}
if (Engine.awsClient.isLoggedIn) {
if (!PlatformHelper.hasPermissions) {
if (askForPermissions) {
PlatformHelper.requestPermissions();
}
} else {
Engine.awsClient.registerPushNotificationEndpoint(PushNotifications.token, PlatformHelper.deviceManufacturer + " " + PlatformHelper.deviceModel, PlatformHelper.deviceSerial);
if (!Engine.awsClient.isLoggedIn) {
print("AWS not logged in. Cannot register for push");
return;
}
if (PushNotifications.token.length === 0) {
print("Don't have a token yet. Cannot register for push");
return;
}
if (!PlatformHelper.hasPermissions) {
if (askForPermissions) {
PlatformHelper.requestPermissions();
}
} else {
Engine.awsClient.registerPushNotificationEndpoint(PushNotifications.token, PlatformHelper.deviceManufacturer + " " + PlatformHelper.deviceModel, PlatformHelper.deviceSerial);
}
}

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 919 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 759 B

After

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB