notification.contentIntent?.send()
it is not working when i set targetSdk=34 .
Notification is got from Notification Listener Service by fetching other apps notifications. to get notification from other app is below as:
class NotificationListenService : NotificationListenerService() {
override fun onCreate() {
super.onCreate()
}
override fun onNotificationRemoved(sbn: StatusBarNotification) {
super.onNotificationRemoved(sbn)
}
override fun onNotificationPosted(sbn: StatusBarNotification) {
super.onNotificationPosted(sbn)
notification=sbn.notification
}
}
I want to open that specific app with a specific screen pending intent, like if I have WhatsApp notification pending intent, then open the details messages screen of a user who sent that notification on calling.
notification.contentIntent?.send()
New contributor
Zohaib Talha is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.