[英]Receive Notification text info
如果我收到来自 twitter 的通知,那么我想从中获取所有文本。 如果它是由用户“ABCD”(@abcd)发布的,并且推文包含“你好”,那么“做这件事”。
那么我怎样才能做到这一点? 有没有像广播接收器这样的通知接收器?
您可以使用 NotificationListenerService 来接收通知。 然后,根据您的应用程序的要求,解析通知的内容并执行您想要的操作。
这是NotificationListenerService 的文档。 设置起来看起来相当简单。 您需要向 AndroidManifest.xml 添加一个节点,然后创建一个扩展 NotificationListenerService 的类。
这是 Github 上某人使用 NotificationListenerService 的示例。
[英]Not Receive notification Firebase
[英]Check database and receive android notification
[英]GeofencingApi addGeofences doesnt receive notification
[英]Android: Connect to website, Authenticate, Send Info, Receive Info
[英]Client can't receive info from Server
[英]Receive file info using DataInputStream and write it
[英]Linking inputted text info
[英]How to work notification when receive message
[英]Android Studio, receive notification on date if close to location
[英]Refresh listview adapter on GSM notification receive
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.