@capgo/capacitor-stream-call 0.0.94 → 0.0.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -605,8 +605,17 @@ class StreamCallPlugin : Plugin() {
|
|
|
605
605
|
callerName: String?,
|
|
606
606
|
shouldHaveContentIntent: Boolean
|
|
607
607
|
): NotificationCompat.Builder {
|
|
608
|
-
|
|
609
|
-
|
|
608
|
+
val keyguardManager = application.getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager
|
|
609
|
+
val isLocked = keyguardManager.isKeyguardLocked
|
|
610
|
+
|
|
611
|
+
return if (isLocked) {
|
|
612
|
+
// Only full-screen intent when locked to avoid double notification
|
|
613
|
+
builder.setFullScreenIntent(fullScreenPendingIntent, true)
|
|
614
|
+
} else {
|
|
615
|
+
// Both intents when unlocked for clickable notification
|
|
616
|
+
builder.setContentIntent(fullScreenPendingIntent)
|
|
617
|
+
.setFullScreenIntent(fullScreenPendingIntent, true)
|
|
618
|
+
}
|
|
610
619
|
}
|
|
611
620
|
}
|
|
612
621
|
)
|
package/package.json
CHANGED