[Android] [@nativescript/geolocation] Cannot watch location. Call "enableLocationRequest" first
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- android, typescript
- 領域
- mobile-dev
調査の方向性
まず Android API 35 で @nativescript/geolocation 9.0.0 を使用してサンプルを再現し、その後、バージョン 8.3.1 と動作を比較します。権限の永続化を含め、enableLocationRequest と watchLocation のフローを確認します。誤ったメッセージが表示されずに監視が成功し、ドキュメントに記載された非同期動作が明確になれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 206
- フォーク
- 123
- 平均マージ
- 2日 1時間
- マージ済み PR(30日)
- 1
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NativeScript/plugins のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
NativeScript/plugins#680 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NativeScript/plugins#671 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
NativeScript/plugins#640 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
NativeScript/plugins#668 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
NativeScript/plugins#665 · コメント 1 件 ·
NativeScript/plugins の issue をすべて見る
似ている issue
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
-
code-quality refactoring
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
langchain-ai/deepagents#6450 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
vercel/react-tweet#225 ·