Skip to content

LocationManager.init callback sometimes returns undefined in the first call #42

@tsdmrfth

Description

@tsdmrfth

Hence the title, we've had LocationManager initialization issue in our TMA.

LocationManager.init() call returns the below result

{
    "isInited": false,
    "isLocationAvailable": false,
    "isAccessRequested": false,
    "isAccessGranted": false
  }

and the LocationManger.init with callback returns undefined callback value.

LocationManager.init((isInitialized) => {
    // typeof isInitialized is undefined here
})

However I've noticed that the second call to LocationManager.init results with success so I've used the workaround below

if (!WebApp.LocationManager.isInited) {
    if (WebApp.LocationManager.init().isInited) {
        manageLocation()
    } else {
        setTimeout(() => {
            manageLocation()
        }, 50)
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions