locationProviderFactory

fun locationProviderFactory(locationProviderFactory: DeviceLocationProviderFactory, locationProviderType: String): LocationOptions.Builder

Set custom location provider implementation.

Return

the same builder

Parameters

locationProviderFactory

a lambda that creates custom location provider based on a request. If not set, default location provider is used. Note that locations emitted by a custom location provider must set a valid value for isMock extra flag: real locations must have it set to false or not set at all, while mocked/simulated locations must have it set to true. Every location object specifies this flag, so if your location provider's type is LocationProviderType.MIXED, emitted locations will just have different flag values, depending on whether they are real or mocked. To set this flag, use:

Location.Builder#extra(Value.valueOf(hashMapOf(LocationExtraKeys.IS_MOCK to Value.valueOf(true/false))))
locationProviderType

this parameters tells the SDK what is the nature of locations that custom location provider will emit. Can be one of the values listed in LocationProviderType.Type.