[Android] [@nativescript/geolocation] Cannot watch location. Call "enableLocationRequest" first
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- android, typescript
- Ambito
- mobile-dev
Direzione di ricerca
Inizia riproducendo l’esempio con @nativescript/geolocation 9.0.0 su Android API 35, quindi confrontane il comportamento con la versione 8.3.1. Verifica il flusso di enableLocationRequest e watchLocation, inclusa la persistenza dell’autorizzazione; il lavoro è completato quando il monitoraggio ha successo senza il messaggio errato e il comportamento asincrono documentato è chiaro.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I call watchLocation properly after enableLocationRequest but I am getting Cannot watch location. Call "enableLocationRequest" first error message.
Other weird behavior:
- It seems even if I allow the location permission, it forgets and requests it again.
- the docs says watchLocation is now async in order to check for permissions before attempting to watch but this is meaningless this way, since still the callback sends the location, this part is very unclear, and I couldn't find any examples for v9
✔ Component nativescript has 8.8.2 version and is up to date.
✔ Component @nativescript/core has 8.8.6 version and is up to date.
✖ Component @nativescript/ios is not installed.
✔ Component @nativescript/android has 8.8.6 version and is up to date.
"@nativescript/geolocation": "^9.0.0",
Code:
Geolocation.enableLocationRequest(true, true).then(() => {
Geolocation.watchLocation(
location => {
console.log(location);
},
e => {
console.log('watchLocation ERROR:', e);
},
{
//Specifies desired accuracy in meters.
desiredAccuracy: CoreTypes.Accuracy.any,
updateDistance: 300,
updateTime: 10000,
minimumUpdateTime: 1000
}
).then(()=>{
console.log('WHAT IS THIS FOR?')
})
UPDATE:
Downgrading to 8.3.1 solved all the issues and everything is working. I am on API 35.
So this is clearly a bug with 9.0.0 or the documentation is inaccurate and I should do something differently.
- Lingua principale
- TypeScript
- Stelle
- 206
- Fork
- 123
- Merge medio
- 2g 1h
- PR unite (30g)
- 1
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NativeScript/plugins
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
NativeScript/plugins#680 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
NativeScript/plugins#671 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
NativeScript/plugins#640 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
NativeScript/plugins#668 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
NativeScript/plugins#665 · 1 commento ·
Tutte le issue di NativeScript/plugins
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
Add: Star Sports 2 Telugu HD Apertacheck:passed streams:add
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100