Recent searches


No recent searches

Android SDK initialize errors reporting/processing



Posted Sep 03, 2024

The points  I want to discuss are related to the Android SDK initialization process.

 

initialize(Context  context, String  channelKey, SuccessCallback<Zendesk> successCallback, FailureCallback<Throwable > failureCallback, MessagingFactory messagingFactory)

  

We have determined that the first init call must occur with an active internet connection, while subsequent calls succeed even without it. We want to ensure that the Zendesk instance is initialized. Should we check the connection status before calling init and do this only for the first launch? How can we determine when this check is necessary and when it is not?

 

In addition, in the failureCallback, we receive a Throwable, and if we want to track connection failures, we need to know all the types of exceptions that can occur during the initialization process in offline mode (for example, java.net.UnknownHostException, …).

 

I believe that the failureCallback should receive either your internal exception and/or an enum indicating a connection failure. This way, it would be easy for us to understand that the initialization issue is specifically related to being offline, and we can retry when we are back online.

 

Something like that:

public fun interface FailureCallback<E : Throwable> {
    public fun onFailure(code: ZendeskErrorCodes,  error: E)
}

 

Thank you in advance for your support and participation. I look forward to your insights on resolving this issue.


0

0

0 comments

Please sign in to leave a comment.

Didn't find what you're looking for?

New post