听传入的WhatsApp的消息/通知消息、通知、WhatsApp

2023-09-05 06:16:25 作者:Ak47金牌马子

我工作的通知基础的应用程序,为此,我需要听来电通知。我已经能够听来电,短信,邮件等。我不知道如何监听通过code坪或消息从WhatsApp的朋友。可以这样实际上可以做什么?如果是这样,怎么样?可以无障碍服务用于此,采用包名称为com.whatsapp?

I'm working on a notification based app, for which I need to listen to incoming notifications. I've been able to listen to incoming call,sms, mail etc. I have no clue how to listen for pings or messages from friends on Whatsapp via code. Can this actually be done? If so , how? Can Accessibility Service be used for this, using Package Name as "com.whatsapp" ?

感谢您的建议。

推荐答案

我是能够做到这一点使用无障碍服务的。利用这一点,你可以听通知栏上的所有通知。我听了应用规范中加入了包名的辅助服务服务信息,在这种情况下是 com.whatsapp 。我无法读取邮件,但我得到通知,每当有消息到达。

I was able to do this using Accessibility Service . Using this, you can listen to all notification on the notification bar. I listened to application-specification by adding the package name to the Accessibility Service service info , which in this case was com.whatsapp. I couldn't read the messages, but I get notified whenever a message arrives.

 
精彩推荐
图片推荐