简体   繁体   中英

Receive Notification text info

If I get notification from twitter then I want to get all the text from it. if it's tweeted by user "ABCD" (@abcd) and the tweet contains "Hello" so "do this stuff".

So how can i get to that? Is there any notification receiver like broadcast receiver?

You can use the NotificationListenerService to receive the notifications. Then, depending on your app's requirements, parse the contents of the notification and perform your desired action.

Here is the documentation for NotificationListenerService. It looks fairly straight forward to set up. You'll need to add a node to your AndroidManifest.xml and then create a class that extends NotificationListenerService.

Here is an example on Github of someone using the NotificationListenerService.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM