如何检测何时打开Facebook Messenger气泡? [英] How to detect when Facebook messenger is bubble is opend?

查看:112
本文介绍了如何检测何时打开Facebook Messenger气泡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Facebook使用一项服务在Android上推送Messenger气泡-如下所示: http://www.piwai.info/chatheads-basics/

Facebook uses a service to push the messenger bubble on android - something like the follows: http://www.piwai.info/chatheads-basics/

我想检测气泡何时打开/关闭

我已经开始研究以下选项-

I've started investigating the following options -

  • 收听(通过拉动)正在运行的服务-我发现显示Messenger时有4个服务,杀死Messenger时有2个服务.我想知道信使气泡何时关闭,以至于无济于事.

  • Listen (By pulling) to the running services - I found out there are 4 services when the messenger is shown and 2 when it's killed. I want to know when the messenger bubble is close so it doesn't help me.

收听通知-我知道何时将其完全删除(当用户将其拖动到"X"区域时)-也无济于事.

Listen to the notifications - I know when it's removed completely (when user drags it to the 'X' area) - also didn't help.

我正在寻找黑客,以了解Facebook气泡何时打开以及何时关闭.

I'm looking for a hack to know when does the Facebook bubble is opened and when does it closes.

推荐答案

通过打开/关闭,您的意思是聊天气泡仍保留在屏幕上,并且聊天窗口已打开/关闭,或者该气泡是可见的还是不可见的?如果是后者:

By open\closed did you mean that the chat bubble remains on screen and the chat window is opened\closed, or that the bubble is either visible or invisible? In case of the latter:

检查 AndroidManifest.xml ,我们可以看到以下内容:

Inspecting the AndroidManifest.xml we can see the following:

<receiver android:name="com.facebook.orca.chatheads.service.ChatHeadsServiceBroadcastReceiver"
          android:permission="com.facebook.permission.prod.FB_APP_COMMUNICATION">
    <intent-filter android:priority="499">
        <action android:name="com.facebook.orca.chatheads.ACTION_SHOW_CHATHEADS"/>
        <action android:name="com.facebook.orca.chatheads.ACTION_HIDE_CHATHEADS"/>
        <action android:name="com.facebook.orca.chatheads.ACTION_SET_CHATHEADS_POLICY"/>
    </intent-filter>
</receiver>

您可能会尝试在自己的服务中拦截这些广播,并以某种方式跟踪气泡的打开/关闭.

You could possibly try to intercept these broadcasts inside a service of your own and track the opening\closing of the bubbles somehow.

(披露:我本人从未尝试过类似的尝试,如果此建议不切实际,我很乐意修改/删除此答案)

(Disclosure: I never tried anything like that myself, and would be happy to revise\delete this answer if this suggestion proves impractical)

这篇关于如何检测何时打开Facebook Messenger气泡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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