fix push registering on iOS, improve android push notification icons
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 919 B |
|
Before Width: | Height: | Size: 759 B After Width: | Height: | Size: 578 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 3.3 KiB |