NavAppClientSdkProvider

object NavAppClientSdkProvider

Should be used to get an instance of NavAppClient when there is need to call one of its APIs. This class manages the lifecycle of NavApp ClientSDK client (NavAppClient) instances. getClientSdk should be used instead of manually instantiating NavAppClient. NavAppClient instances are costly to create and this class shares a single instance per process between callers. The returned instance will remain available until all LifecycleOwners that requested an instance are destroyed. NavAppClient.close should not be called directly.

Functions

Link copied to clipboard
@MainThread
fun getClientSdk(context: Context, lifecycleOwner: LifecycleOwner): NavAppClient

Provides an instance of NavAppClient that is initialized to operate in context and that will be kept alive at least until lifecycleOwner is destroyed.