mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-13 07:44:11 +01:00
Fix some notifications stuff
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
51d8483267
commit
8c984973c0
@ -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()
|
||||
|
@ -50,6 +50,7 @@
|
||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<uses-permission
|
||||
android:name="android.permission.USE_CREDENTIALS"
|
||||
|
@ -116,12 +116,8 @@ object NotificationUtils {
|
||||
channel.enableLights(enableLights)
|
||||
channel.lightColor = R.color.colorPrimary
|
||||
channel.setSound(sound, audioAttributes)
|
||||
if (vibrationPattern != null) {
|
||||
channel.enableVibration(true)
|
||||
channel.vibrationPattern = vibrationPattern
|
||||
} else {
|
||||
channel.enableVibration(false)
|
||||
}
|
||||
channel.vibrationPattern = vibrationPattern
|
||||
|
||||
channel.setBypassDnd(bypassDnd)
|
||||
if (lockScreenVisibility != null) {
|
||||
channel.lockscreenVisibility = lockScreenVisibility
|
||||
|
Loading…
Reference in New Issue
Block a user