createPlanPresenter

fun createPlanPresenter(planLink: ExpoFpLinkType, additionalParams: List<ExpoFpPlanParameter> = emptyList(), locationProvider: IExpoFpLocationProvider? = globalLocationProvider, messageListener: IExpoFpPlanMessageListener? = null, isDebugModeEnabled: Boolean = false): IExpoFpPlanPresenter

Create a plan presenter.

The presenter is disposed automatically when the LifecycleOwner of the view tree it is first shown in is destroyed. To manage its lifetime yourself, use the overload that takes isLifecycleAutoDisposeEnabled.

Return

IExpoFpPlanPresenter to manage the plan.

Parameters

planLink

type of the link to load a plan.

additionalParams

parameters to configure the plan before presenting.

locationProvider

location provider to be used (defaults to globalLocationProvider).

messageListener

listener for messages from the plan. Note: the SDK does not retain it; keep your own strong reference for as long as you need callbacks.

isDebugModeEnabled

Enables sending DEBUG messages via IExpoFpPlanMessageListener. When true, the presenter forwards JavaScript runtime errors and console output from the plan to:

Warning: Do not turn on Debug mode in production, it may slow down the plan initialization and response. Use only for debugging!

Throws

if initialize was not called before.


fun createPlanPresenter(planLink: ExpoFpLinkType, additionalParams: List<ExpoFpPlanParameter> = emptyList(), locationProvider: IExpoFpLocationProvider? = globalLocationProvider, messageListener: IExpoFpPlanMessageListener? = null, isDebugModeEnabled: Boolean = false, isLifecycleAutoDisposeEnabled: Boolean): IExpoFpPlanPresenter

Create a plan presenter and choose whether it is disposed automatically.

Return

IExpoFpPlanPresenter to manage the plan.

Parameters

planLink

type of the link to load a plan.

additionalParams

parameters to configure the plan before presenting.

locationProvider

location provider to be used (defaults to globalLocationProvider).

messageListener

listener for messages from the plan. Note: the SDK does not retain it; keep your own strong reference for as long as you need callbacks.

isDebugModeEnabled

Enables sending DEBUG messages via IExpoFpPlanMessageListener. When true, the presenter forwards JavaScript runtime errors and console output from the plan to:

Warning: Do not turn on Debug mode in production, it may slow down the plan initialization and response. Use only for debugging!

isLifecycleAutoDisposeEnabled

When true, the presenter is disposed automatically when the LifecycleOwner of the view tree it is first shown in is destroyed. Pass false when that LifecycleOwner can be destroyed while the screen showing the plan is still in use, for example a Fragment whose view is destroyed while it is in the back stack and recreated on back navigation. In that case the presenter keeps its plan alive until you call IExpoFpPlanPresenter.dispose, and you must call it once the plan is no longer needed.

Throws

if initialize was not called before.