• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps How to get individual notifications from Whatsapp?

AlexN7

Lurker
Hi, I'm new on this forum, is there anyone knows how to get individual notifications from whatsapp using a NotificationListenerService? at this time I can get correctly a message when it is the only, if the service receive another message the notification that I get is only "Whatsapp" because are grouped. This is the onNotificationPosted in my NotificationListenerService:

Code:
@Override
    public void onNotificationPosted(StatusBarNotification sbn) {
        
        Notification mNotification=sbn.getNotification();
        
        if (mNotification!=null && checkPackage(sbn.getPackageName())){
            Bundle extras = mNotification.extras;
            Log.d("Title", extras.getString(Notification.EXTRA_TITLE));
            
            Intent intent = new Intent(this,GUI.class);
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            intent.putExtra("extras", extras);
            startActivity(intent);
        }

        
    }
 
maybe I explained badly, now I'll try to explain the problem again:

if I use NotificationListenerService as the code in OP with whatsapp notifications I get only the first notification from where I can get Title of message and Content, so if I receive two or more message, when I get the notification I can get only the generic title that is "Whatsapp": how can get the subsequent notification as individual message?
 
Back
Top Bottom