How to read all the coming notifications in android. Is it possible to use the broadcast receiver to listen the incoming notifications and the ability to read the notificati
You need to do like this in onNotificationPosted in order to get all messages
if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)){
Parcelable b[] = (Parcelable[]) extras.get(Notification.EXTRA_MESSAGES);
if(b != null){
for (Parcelable tmp : b){
Bundle msgBundle = (Bundle) tmp;
content = content + msgBundle.getString("text") + "\n";
/*Set io = msgBundle.keySet(); // To get the keys available for this bundle*/
}
}
}