Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tsdmrfth opened this issue Dec 19, 2024 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@tsdmrfth
Copy link

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)
    }
}
@ArthurStam
Copy link
Member

Please specify type and version of Telegram client.

@ArthurStam ArthurStam added the help wanted Extra attention is needed label Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Development

No branches or pull requests

2 participants