I'm currently working on a chatbot inside a Xamarin.Forms application. Communication between the application and the bot is being done using the DirectLine SDK (C#). I'm running into walls on several fronts, considering the SDK hasn't been updated since 2017 and its documentation is rather lackluster.
In order to let a user know whether the chatbot is accessible or not, I'd like to add a simple status icon indicating the status of the chatbot. This status icon is linked to the connection status of the chatbot, but this is where I've hit a wall. Is there a way to check whether connection to the chatbot has succeeded? I've tried using the somewhat updated Universal version by ong.andrew, but failure to connect seems to result in an uncatchable exception.
Lack of documentation and general missing information aren't very helpful, so I'm hoping someone on here has experience with the use of the DirectLine SDK. Thanks in advance!
If you mean something like an online indicator, the simplest way would probably be to periodically send a quick request (such as getting the very last message using the watermark) to the bot and check the response that comes back. This will also serve to wake the bot up if it has gone idle. If you get something other than a 2xx response code, you know there's something wrong with the bot. You can then update the XAML accordingly.
Alternatively, since Direct Line doesn't really have an "online indicator" as such, you could also report to the user whether each message was sent successfully or not through the use of color, text, etc. Once again, each interaction with the Direct Line channel should result in an HTTP response code. Use that to decide what to tell the user.
Hope that makes sense.