听传入的WhatsApp的消息/通知 [英] Listen to incoming Whatsapp messages/notifications

本文介绍了听传入的WhatsApp的消息/通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的通知基础的应用程序,为此,我需要听来电通知。我已经能够听来电,短信,邮件等。我不知道如何监听通过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 <​​/ code>。我无法读取邮件,但我得到通知,每当有消息到达。

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.

这篇关于听传入的WhatsApp的消息/通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆