Android : Notification listener service for WhatsApp

on Sunday, August 31, 2014


I'm using the last Kikat API to acess to the user notification and get some data. Currently I use this code:



@Override
public void onNotificationPosted(StatusBarNotification arg0) {
String originator = arg0.getPackageName();
Bundle extras = arg0.getNotification().extras;
if (extras != null) {
String title = extras.getString(Notification.EXTRA_TITLE);
String subText = extras.getString(Notification.EXTRA_SUB_TEXT);
String text = extras.getString(Notification.EXTRA_TEXT);
CharSequence ticker = arg0.getNotification().tickerText;
//do something
}
}


This code doesn't work with multiple messages of WhatsApp. Unfortunately I don't use this app so I don't know what fields uses. Can someone give me some information? Can someone share a dumpsys notificationADB command output?


0 comments:

Post a Comment