Package ch.nevis.mobile.sdk.api
Interface MobileAuthenticationClientInitializer
public interface MobileAuthenticationClientInitializer
The class that creates and initializes asynchronously an instance of
MobileAuthenticationClient
.-
Method Summary
Modifier and TypeMethodDescriptionapplication
(android.app.Application application) Deprecated.configuration
(Configuration configuration) Sets the configuration of theMobileAuthenticationClient
.context
(android.content.Context context) Sets the Android context.void
execute()
Starts the creation of an instance of theMobileAuthenticationClient
.Returns a newMobileAuthenticationClientInitializer
.onError
(Consumer<InitializationError> errorConsumer) The object invoked when an error occurs after invokingexecute()
.onSuccess
(Consumer<MobileAuthenticationClient> mobileAuthenticationClientConsumer) The method invoked when theMobileAuthenticationClient
could be successfully built after invokingexecute()
.
-
Method Details
-
application
@Deprecated(since="3.7.0") MobileAuthenticationClientInitializer application(android.app.Application application) Deprecated.usecontext(Context)
instead.Sets the Android application.- Parameters:
application
- the Android application.- Returns:
- an initializer
-
context
Sets the Android context. If you plan to use the same instance of theMobileAuthenticationClient
across different activities, this must be the application context.Providing the context is required.
- Parameters:
context
- the Android context.- Returns:
- an initializer
-
configuration
Sets the configuration of theMobileAuthenticationClient
.Providing the configuration is required.
- Parameters:
configuration
- theMobileAuthenticationClient
configuration.- Returns:
- an initializer
-
onError
The object invoked when an error occurs after invokingexecute()
. This object will be invoked in the main/UI thread.Providing the object handling the error is required.
- Parameters:
errorConsumer
- the object handling the error- Returns:
- an initializer
-
onSuccess
MobileAuthenticationClientInitializer onSuccess(Consumer<MobileAuthenticationClient> mobileAuthenticationClientConsumer) The method invoked when theMobileAuthenticationClient
could be successfully built after invokingexecute()
. This object will be invoked in the main/UI thread.Providing the object handling the
MobileAuthenticationClient
is required.- Parameters:
mobileAuthenticationClientConsumer
- the object handling theMobileAuthenticationClient
- Returns:
- an initializer
-
execute
void execute()Starts the creation of an instance of theMobileAuthenticationClient
. If an error occurs, it is provided throughonError(Consumer)
, if theMobileAuthenticationClient
can be successfully built and initialized, it is provided throughonSuccess(Consumer)
. -
initializer
Returns a newMobileAuthenticationClientInitializer
.- Returns:
- a new
MobileAuthenticationClientInitializer
-
context(Context)
instead.