I am writing an accessibility app that helps users navigate on android using a mixture of voice controls and controls provided via external aiding tools. It uses MonkeyTalk Java API to do the heavier work.
To help the user about what is happening we use an accessibility service as well, which reads notification so the user can take action faster.
I've been informed that they get no audio cue when a message arrives on facebook messenger, and checking logs what I see is:
D/NotificationService(2665): package com.facebook.orcaText: []
and event.getText().size()
returns 0 (on AccessibilityEvent event).
Right now they have to open the app and get the text read to them, which is 2 voice commands more...
I get all the other notifications correctly. I tried looking for documentation from facebook about their stance on accessibility but I found nothing.
Is there any way to get the text from their notifications?
You can try this to see if it works with Facebook messenger notifications. And even if this does work, I would suggest that you wait for a better solution.
From API 19 and above,
Notification
objects carry bundledextras
- the inputs passed toNotification.Builder
when theNotification
was first created. So, information such as thetitle
,context
,summary
etc. can be extracted from thisBundle
using keys of formNotification.EXTRAS_XXXX
. The keys can be found here: Link.In the overriden
onAccessibilityEvent(AccessibilityEvent event)
method:extractTextFromNotification(Notification)
can be a method from here: Link. Needless to say that this is a workaround, and will require quite a bit of testing to ensure that it works as required.