|
@@ -180,23 +180,7 @@ class CallkitNotificationManager(private val context: Context) {
|
|
|
.into(createAvatarTargetDefault(notificationId))
|
|
.into(createAvatarTargetDefault(notificationId))
|
|
|
}
|
|
}
|
|
|
val caller = data.getString(CallkitConstants.EXTRA_CALLKIT_NAME_CALLER, "")
|
|
val caller = data.getString(CallkitConstants.EXTRA_CALLKIT_NAME_CALLER, "")
|
|
|
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
|
|
|
|
- val person = Person.Builder()
|
|
|
|
|
- .setName(caller)
|
|
|
|
|
- .setImportant(
|
|
|
|
|
- data.getBoolean(CallkitConstants.EXTRA_CALLKIT_IS_IMPORTANT, false)
|
|
|
|
|
- )
|
|
|
|
|
- .setBot(data.getBoolean(CallkitConstants.EXTRA_CALLKIT_IS_BOT, false))
|
|
|
|
|
- .build()
|
|
|
|
|
- notificationBuilder.setStyle(
|
|
|
|
|
- NotificationCompat.CallStyle.forIncomingCall(
|
|
|
|
|
- person,
|
|
|
|
|
- getDeclinePendingIntent(notificationId, data),
|
|
|
|
|
- getAcceptPendingIntent(notificationId, data),
|
|
|
|
|
- )
|
|
|
|
|
- .setIsVideo(typeCall > 0)
|
|
|
|
|
- )
|
|
|
|
|
- } else {
|
|
|
|
|
|
|
+
|
|
|
notificationBuilder.setContentTitle(caller)
|
|
notificationBuilder.setContentTitle(caller)
|
|
|
val textDecline = data.getString(CallkitConstants.EXTRA_CALLKIT_TEXT_DECLINE, "")
|
|
val textDecline = data.getString(CallkitConstants.EXTRA_CALLKIT_TEXT_DECLINE, "")
|
|
|
val declineAction: NotificationCompat.Action = NotificationCompat.Action.Builder(
|
|
val declineAction: NotificationCompat.Action = NotificationCompat.Action.Builder(
|
|
@@ -212,7 +196,7 @@ class CallkitNotificationManager(private val context: Context) {
|
|
|
getAcceptPendingIntent(notificationId, data)
|
|
getAcceptPendingIntent(notificationId, data)
|
|
|
).build()
|
|
).build()
|
|
|
notificationBuilder.addAction(acceptAction)
|
|
notificationBuilder.addAction(acceptAction)
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
val notification = notificationBuilder.build()
|
|
val notification = notificationBuilder.build()
|
|
|
notification.flags = Notification.FLAG_INSISTENT
|
|
notification.flags = Notification.FLAG_INSISTENT
|