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
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?
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".
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.
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])
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.