Facebook messenger API bot : "Typing bubble" " indicator bubble"
Asked Answered
G

4

18

I've created a messenger bot, and some action that I perform can take some time. So in order to make the user wait I would like to display the "Indicator Bubble" (the one you see when the people you talk with are typing):

Typing bubble

Enter image description here

It is not defined in the Messenger API documentation how to do it, but it seems possible has they perform it when you hit "callBack" on their card.

How can I simulate this?

Germanophile answered 27/4, 2016 at 11:3 Comment(0)
T
18

It's now available into the messenger bot API via the Sender Action. You can find the documentation here.

It's just a post with an on or off value to display / hide the bubble indicator.

{
    "recipient":{
          "id":"USER_ID"
    },
    "sender_action":"typing_on" // typing_off
}
Tracietracing answered 13/7, 2016 at 9:11 Comment(2)
What is the USER_ID, is it for the FB account that created the page of the Bot, or is it an ID of the bot itself?Streptomycin
No it's the ID of the user your bot is talking to. The sender parameter of a message your bot has received (developers.facebook.com/docs/messenger-platform/…)Tracietracing
D
0

Yes, it is the only way.

When you have the Button Template and someone clicks on "button" for "postback" (documentation in section "button template").

Then during your parsing of the message and sending answer, it is shown like "writing".

Decalescence answered 28/4, 2016 at 15:26 Comment(3)
But do you think there is a work around to achieve the same result without the user hitting a "postback button" ? My point is that it can be frustrating for the user to wait the bot answer. But if there is the bubble showing that the bot is actually processing something, the user will wait and not firing new message thinking that the bot didn't get it.Germanophile
@HenriChabrand I have the same issue, did you find a workaround ?Lateral
No, I didn't find any workaround yet. I let you know if I have better luck on other forum.Germanophile
M
0

The official messenger API does not support this feature for now. Even if @hiponcho – one of the featured by Facebook chatbot is actually using it.

A workaround would be to use the unofficial messenger API, which has a method called sendTypingIndicator that does exactly what you want. But be careful, you can be banned for using of non-official API.

api.sendTypingIndicator(threadID, [callback])

Manuel answered 25/6, 2016 at 19:24 Comment(0)
G
-1

I know it is a hack, but currently I send the "Typing Bubble Indicator" as a animated gif as my first reply, if I anticipate a waiting time (like an API call). At the user end, you can't tell the difference.

Grindery answered 4/6, 2018 at 10:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.