retryOnErrorInterceptor
Sets the ApolloInterceptor used to retry or fail fast a request. The interceptor may use ApolloRequest.retryOnError and ApolloRequest.failFastIfOffline. The interceptor is also responsible for allocating a new ApolloRequest.requestUuid on retries if needed.
By default ApolloClient uses a best effort interceptor that is not aware about network state, uses exponential backoff and ignores ApolloRequest.failFastIfOffline.
Use RetryOnErrorInterceptor to add network state awareness:
apolloClient = ApolloClient.Builder()
.serverUrl("https://...")
.retryOnErrorInterceptor(RetryOnErrorInterceptor(NetworkMonitor(context)))
.build()
Content copied to clipboard
Parameters
retryOnErrorInterceptor
the ApolloInterceptor to use for retrying or null
to use the default interceptor.