Search code examples
javaandroidkotlinandroid-developer-api

Is there a way to get information about other apps notifications in android?


I tried to search for a way to get other apps notifications in Java or kotlin, but I couldn't find anything. For example, let's suppose Facebook sent you a push notification, is there any way I can use to get informations (e.g. content, or images that appear on the push notification) about this Facebook notification on the local device using java or kotlin?


Solution

  • Not sure if there is a way to do this, but I've read that there is a NotificationListenerService that you can use to get information from active notifications. I haven't used it myself. But seems like a good point to start. There is a particular method you may want to check: onNotificationPosted

    I'll link documentation.

    NotificationListenerService

    Hope it's of any help.