crisp-sdk-android
crisp-sdk-android copied to clipboard
Callback for starting chat errors
In this moment, if the sdk have some problems to connect to the chat, the developer cannot do nothing and user see a bad dialog that ask to retry. In my case, some conversation doesn't work and the unique method is to change the token session for that user. So i ask a callback error from your sdk to the android app, so the developer can manage it
Hi @francescogatto and thank you for your feedback.
Upon chat initialization (first 15s), if any error occured until a complete connection to the chat socket, this error dialog appears.

Here, the user is given 2 options:
- Hit the "TRY AGAIN" button and relaunch the connection process,
- Hit the "CANCEL" button to exit the Crisp chat and go back to the app.
What you wish from the SDK is to fire a callback when the error occured or before relaunching the whole connection process when the user hits the "TRY AGAIN" button? In both ways, I think the SDK will need the feedback that the hosting app has handled the error (doing something or not) in order to relaunch the connection process knowing that the app has finish handling the error.
As in the future, the Crisp chat should be embeddable as a fragment (#70), all this process should be managed by the Crisp
class from the app perspective. We could provide in it a new ConnectionErrorListener
which could be set by a new configure
call along the existing one (which will set it to null
to keep the current behavior) or by its own setter. For the callback itself, it could be either synchrone or asynchrone depending on when we fire the error to the app, when the error occurs or on the "TRY AGAIN" tap. I confess I prefer the 2nd solution as the existing code to try again the chat connection is already async ;)
public interface ConnectionErrorListener
{
// SYNC
boolean onConnectionError();
// OR ASYNC
onConnectionError(@NonNull final Runnable onComplete);
}
public static void configure(@NonNull Context context, @NonNull String websiteID, @Nullable ConnectionErrorListener listener);
public static void setConnectionErrorListener(@Nullable ConnectionErrorListener listener)
Let me know if this is what you expected :)
Hi @francescogatto
1.0.13
has just been released and it could fix the issue about the "Starting chat" dialog.
Could you give it a try?
If you want more details about it, I have opened issue #133 especially to explain what has been fixed.
Without any feedback since more than a year, I consider this issue fixed. Closing it.