Below is my code for bubble notification,
Notification.BubbleMetadata bubbleData =
new Notification.BubbleMetadata.Builder()
.setIcon(Icon.createWithResource(this, R.drawable.notification_logo))
.setIntent(incomingCallPendingIntent)
.build();
// Create notification
Person chatBot = new Person.Builder()
.setBot(true)
.setName("BubbleBot")
.setImportant(true)
.build();
Notification.Builder builder =
new Notification.Builder(this, NOTIFICATION_CHANNEL_ID)
.setContentIntent(incomingCallPendingIntent)
.setLargeIcon(getCircleBitmap(drawable.getBitmap()))
.setOngoing(true)
.setColor(ContextCompat.getColor(context, R.color.blue))
.setContentTitle(displayName)
.setContentText("Incoming call from "+number)
.setDefaults(Notification.DEFAULT_SOUND | Notification.DEFAULT_LIGHTS | Notification.DEFAULT_VIBRATE)
.setFullScreenIntent(incomingCallPendingIntent, true)
.setSmallIcon(R.drawable.notification_logo)
.setAutoCancel(false)
.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE))
.setVibrate(vibrate)
.setCategory(NotificationCompat.CATEGORY_CALL)
.setSmallIcon(R.drawable.notification_logo)
.addAction(0,"Answer",answerPendingIntent)
.addAction(0,"Cancel",cancelPendingIntent)
.setBubbleMetadata(bubbleData)
.addPerson(chatBot)
startForeground(2,builder.build());
In this, setDefaults,setSound, setVibrate, addAction are deprecated.
And when receiving Incoming call Notification, on tapping the notification not able to get full screen Intent. Instead of that White screen came and goes off. Meanwhile Action buttons are working fine.Only able to see full screen intent activity when the device is in DO NOT DISTURB MODE. I doesn't know whats wrong with my code. Anybody help me with this. Thanks in advance.
If anybody faced this issues, then please share me your ideas