Skip to content

Customizations

Birju Vachhani edited this page Sep 23, 2019 · 4 revisions

Default Configuration

fastestInterval = 1000
priority = LocationRequest.PRIORITY_HIGH_ACCURACY
interval = 1000
maxWaitTime = 2000

rationale=Text = "Location permission is required in order to use this feature properly.Please grant the permission."

blockedText = "Location permission is blocked. Please allow permission from settings screen to use this feature"

Configuring Location Request

Here, request is provides a lambda block to configure LocationRequest.

Locus.configure {
    request {
        fastestInterval = 1000
        priority = LocationRequest.PRIORITY_HIGH_ACCURACY
        interval = 1000
        maxWaitTime = 2000
    }
}

Configuring Dialogs

Change Rationale Dialog Text

Locus.configure {
    rationaleText = "This is custom rationale text."
}

Change Permission Blocked Dialog Text

Locus.configure {
    blockedText = "This is custom permission blocked dialog text."
}

Enable/Disable Location Settings Resolution

Locus.configure {
    enableBackgroundUpdates = true // default: true
}

Enable/Disable Background location permission for Android Q

Locus.configure {
    enableBackgroundUpdates = true // default: false
}

Force user to allow background location permission

Locus.configure {
    forceBackgroundUpdates = true // default: false
}

Reset Location Configurations

Locus.setDefaultConfig()