Viber Api bot keyboard bug

561 Views Asked by At

I have a problem sending messages with the keyboard. Bug reproduction:

  1. The user starts a dialogue with the bot
  2. The user disconnects the network on the phone
  3. The bot sends a message with the keyboard
  4. The bot sends a message without a keyboard
  5. The user turns on the network and opens a dialog

Expected: User will see 2 messages, keyboard will not show

Received: User receives 2 messages + keyboard from the first message

Reproduced only on Android, with the network turned off. If not disabled, the keyboard is not shown On IOS is not reproduced at all

keyboard message is same as from the Viber documentation

I don't use any third-party libraries. All the rest of the functionality works fine, the problem is only in android with a disconnected network

my keyboard message looks like:

{
   "receiver":"01234567890A=",
   "min_api_version":7,
   "type":"text",
   "text":"Hello world",
   "keyboard":{
      "Type":"keyboard",
      "DefaultHeight":true,
      "Buttons":[
         {
            "ActionType":"reply",
            "ActionBody":"reply to me",
            "Text":"Key text",
            "TextSize":"regular"
         }
      ]
   }
}
if message.text == '.':
    viber.send_messages(viber_request.sender.id, [
        get_keyboard_message()
    ])

    viber.send_messages(viber_request.sender.id, [
        get_simple_message()
    ])
0

There are 0 best solutions below