From 8c984973c0a5620a3a326416a4aa98d70d0a26a4 Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Tue, 18 Feb 2020 13:28:39 +0100 Subject: [PATCH] Fix some notifications stuff Signed-off-by: Mario Danic --- .../services/firebase/MagicFirebaseMessagingService.kt | 8 +++++--- app/src/main/AndroidManifest.xml | 1 + .../java/com/nextcloud/talk/utils/NotificationUtils.kt | 8 ++------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/src/gplay/java/com/nextcloud/talk/services/firebase/MagicFirebaseMessagingService.kt b/app/src/gplay/java/com/nextcloud/talk/services/firebase/MagicFirebaseMessagingService.kt index 4a2c9b9f6..db8182afa 100644 --- a/app/src/gplay/java/com/nextcloud/talk/services/firebase/MagicFirebaseMessagingService.kt +++ b/app/src/gplay/java/com/nextcloud/talk/services/firebase/MagicFirebaseMessagingService.kt @@ -24,6 +24,7 @@ import android.app.Notification import android.app.PendingIntent import android.content.Intent import android.media.AudioAttributes +import android.media.AudioManager import android.net.Uri import android.os.Bundle import android.util.Base64 @@ -152,13 +153,14 @@ class MagicFirebaseMessagingService : FirebaseMessagingService(), KoinComponent .setSmallIcon(R.drawable.ic_call_black_24dp) .setSubText(userBaseUrl) .setShowWhen(true) - .setWhen(decryptedPushMessage.timestamp) + .setWhen(timestamp) .setContentTitle(EmojiCompat.get().process(decryptedPushMessage.subject.toString())) .setAutoCancel(true) .setOngoing(true) //.setTimeoutAfter(45000L) + .setContentIntent(fullScreenPendingIntent) .setFullScreenIntent(fullScreenPendingIntent, true) - .setSound(NotificationUtils.getCallSoundUri(applicationContext, appPreferences)) + .setSound(NotificationUtils.getCallSoundUri(applicationContext, appPreferences), AudioManager.STREAM_RING) if (vibrationEffect != null) { notificationBuilder.setVibrate(vibrationEffect) @@ -168,7 +170,7 @@ class MagicFirebaseMessagingService : FirebaseMessagingService(), KoinComponent notification.flags = notification.flags or Notification.FLAG_INSISTENT isServiceInForeground = true checkIfCallIsActive(signatureVerification, decryptedPushMessage) - startForeground(decryptedPushMessage.timestamp.toInt(), notification) + startForeground(timestamp.toInt(), notification) } else -> { val messageData = Data.Builder() diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 0ba43e821..7612f2a4a 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -50,6 +50,7 @@ +