20260111-01
This commit is contained in:
parent
dcff5247bc
commit
f553ff9e53
@ -10,7 +10,7 @@ let package = Package(
|
||||
targets: ["DumonGeolocationPlugin"])
|
||||
],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.0.0")
|
||||
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0")
|
||||
],
|
||||
targets: [
|
||||
.target(
|
||||
@ -25,4 +25,4 @@ let package = Package(
|
||||
dependencies: ["DumonGeolocationPlugin"],
|
||||
path: "ios/Tests/DumonGeolocationPluginTests")
|
||||
]
|
||||
)
|
||||
)
|
||||
|
||||
2
dist/docs.json
vendored
2
dist/docs.json
vendored
@ -392,7 +392,7 @@
|
||||
"tags": [],
|
||||
"docs": "",
|
||||
"complexTypes": [],
|
||||
"type": "'GNSS' | 'IMU' | 'DELTA' | 'NONE' | undefined"
|
||||
"type": "'NONE' | 'GNSS' | 'IMU' | 'DELTA' | undefined"
|
||||
},
|
||||
{
|
||||
"name": "speedGnss",
|
||||
|
||||
34
documentation/IOS_LOCATION_FLOW.md
Normal file
34
documentation/IOS_LOCATION_FLOW.md
Normal file
@ -0,0 +1,34 @@
|
||||
# iOS Location Flow (Dumon Client)
|
||||
|
||||
Tujuan: memastikan `getLatestPosition()` tidak mengembalikan default (lat/lon 0, accuracy 999) di iOS.
|
||||
|
||||
## Aturan utama
|
||||
|
||||
- `getLatestPosition()` hanya mengembalikan snapshot terakhir dari `didUpdateLocations`.
|
||||
- Jika belum ada update lokasi, hasilnya akan default.
|
||||
- Jadi, `startPositioning()` wajib dipanggil dan update pertama harus diterima sebelum `getLatestPosition()` dipakai sebagai sumber data utama.
|
||||
|
||||
## Urutan yang benar
|
||||
|
||||
1. `checkAndRequestPermissions()` dipanggil saat aplikasi siap meminta lokasi.
|
||||
2. Jika `location: granted`, lanjut; jika `denied`, hentikan flow dan minta user aktifkan izin.
|
||||
3. Panggil `startPositioning()` sekali.
|
||||
4. Tunggu event `onPositionUpdate` pertama.
|
||||
5. Gunakan data dari event pertama sebagai sumber posisi awal.
|
||||
6. `getLatestPosition()` baru dipakai setelah event pertama (sebagai snapshot tambahan/fallback).
|
||||
|
||||
## Contoh urutan (pseudo)
|
||||
|
||||
```ts
|
||||
await checkPermission(); // harus granted
|
||||
await continuousWatchPosition(); // startPositioning
|
||||
await waitForFirstOnPositionUpdate(); // resolve saat listener pertama
|
||||
const pos = await getGeoloc(); // sekarang safe
|
||||
```
|
||||
|
||||
## Checklist debugging
|
||||
|
||||
- Pastikan `initiateLocationState()` dipanggil sebelum flow yang butuh posisi.
|
||||
- Pastikan `checkPermission()` sukses sebelum `continuousWatchPosition()`.
|
||||
- Pastikan ada log yang membuktikan `onPositionUpdate` terpanggil.
|
||||
- Jangan panggil `getLatestPosition()` terlalu awal (sebelum update pertama).
|
||||
@ -13,9 +13,9 @@
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@capacitor/android": "^6.0.0",
|
||||
"@capacitor/core": "^6.0.0",
|
||||
"@capacitor/ios": "^6.0.0",
|
||||
"@capacitor/android": "^8.0.0",
|
||||
"@capacitor/core": "^8.0.0",
|
||||
"@capacitor/ios": "^8.0.0",
|
||||
"dumon-geolocation": "file:.."
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
56
package-lock.json
generated
56
package-lock.json
generated
@ -1,18 +1,18 @@
|
||||
{
|
||||
"name": "dumon-geolocation",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "dumon-geolocation",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@capacitor/android": "^6.0.0",
|
||||
"@capacitor/core": "^6.0.0",
|
||||
"@capacitor/android": "^8.0.0",
|
||||
"@capacitor/core": "^8.0.0",
|
||||
"@capacitor/docgen": "^0.3.0",
|
||||
"@capacitor/ios": "^6.0.0",
|
||||
"@capacitor/ios": "^8.0.0",
|
||||
"@ionic/eslint-config": "^0.4.0",
|
||||
"@ionic/prettier-config": "^4.0.0",
|
||||
"@ionic/swiftlint-config": "^2.0.0",
|
||||
@ -22,10 +22,10 @@
|
||||
"rimraf": "^6.0.1",
|
||||
"rollup": "^4.30.1",
|
||||
"swiftlint": "^2.0.0",
|
||||
"typescript": "~4.1.5"
|
||||
"typescript": "~5.8.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@capacitor/core": ">=6.0.0 <8"
|
||||
"@capacitor/core": ">=8.0.0 <9"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/code-frame": {
|
||||
@ -50,19 +50,19 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@capacitor/android": {
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@capacitor/android/-/android-6.2.1.tgz",
|
||||
"integrity": "sha512-8gd4CIiQO5LAIlPIfd5mCuodBRxMMdZZEdj8qG8m+dQ1sQ2xyemVpzHmRK8qSCHorsBUCg3D62j2cp6bEBAkdw==",
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@capacitor/android/-/android-8.0.0.tgz",
|
||||
"integrity": "sha512-FrBSvVAC5JuLaYHNyDnwQny0/SYnP+xDQbc/KA4wInmRkMXLDv22fkx9aBJIDrxjuUVd+jsRih4SAt8FgMEzCw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@capacitor/core": "^6.2.0"
|
||||
"@capacitor/core": "^8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@capacitor/core": {
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@capacitor/core/-/core-6.2.1.tgz",
|
||||
"integrity": "sha512-urZwxa7hVE/BnA18oCFAdizXPse6fCKanQyEqpmz6cBJ2vObwMpyJDG5jBeoSsgocS9+Ax+9vb4ducWJn0y2qQ==",
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@capacitor/core/-/core-8.0.0.tgz",
|
||||
"integrity": "sha512-250HTVd/W/KdMygoqaedisvNbHbpbQTN2Hy/8ZYGm1nAqE0Fx7sGss4l0nDg33STxEdDhtVRoL2fIaaiukKseA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@ -100,13 +100,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@capacitor/ios": {
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-6.2.1.tgz",
|
||||
"integrity": "sha512-tbMlQdQjxe1wyaBvYVU1yTojKJjgluZQsJkALuJxv/6F8QTw5b6vd7X785O/O7cMpIAZfUWo/vtAHzFkRV+kXw==",
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-8.0.0.tgz",
|
||||
"integrity": "sha512-gwSn6X4uHYNHlM8zZmVmM1zjEhexxbHpPSSnH1DZkp8o3zdK/RmH8tmDma+3zPZrhhTSrMC7sT24dKTOvV8www==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@capacitor/core": "^6.2.0"
|
||||
"@capacitor/core": "^8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@chevrotain/cst-dts-gen": {
|
||||
@ -3742,20 +3742,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/swiftlint/node_modules/typescript": {
|
||||
"version": "5.8.3",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/text-table": {
|
||||
"version": "0.2.0",
|
||||
"dev": true,
|
||||
@ -3908,7 +3894,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "4.1.6",
|
||||
"version": "5.8.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
|
||||
"integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
@ -3916,7 +3904,7 @@
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.2.0"
|
||||
"node": ">=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/unbox-primitive": {
|
||||
|
||||
12
package.json
12
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "dumon-geolocation",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"description": "Implement manager GNSS, Wi‑Fi RTT, IMU, Kalman fusion, event emitter",
|
||||
"main": "dist/plugin.cjs.js",
|
||||
"module": "dist/esm/index.js",
|
||||
@ -46,10 +46,10 @@
|
||||
"prepublishOnly": "npm run build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@capacitor/android": "^6.0.0",
|
||||
"@capacitor/core": "^6.0.0",
|
||||
"@capacitor/android": "^8.0.0",
|
||||
"@capacitor/core": "^8.0.0",
|
||||
"@capacitor/docgen": "^0.3.0",
|
||||
"@capacitor/ios": "^6.0.0",
|
||||
"@capacitor/ios": "^8.0.0",
|
||||
"@ionic/eslint-config": "^0.4.0",
|
||||
"@ionic/prettier-config": "^4.0.0",
|
||||
"@ionic/swiftlint-config": "^2.0.0",
|
||||
@ -59,10 +59,10 @@
|
||||
"rimraf": "^6.0.1",
|
||||
"rollup": "^4.30.1",
|
||||
"swiftlint": "^2.0.0",
|
||||
"typescript": "~4.1.5"
|
||||
"typescript": "~5.8.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@capacitor/core": ">=6.0.0 <8"
|
||||
"@capacitor/core": ">=8.0.0 <9"
|
||||
},
|
||||
"prettier": "@ionic/prettier-config",
|
||||
"swiftlint": "@ionic/swiftlint-config",
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
"strict": true,
|
||||
"target": "es2017",
|
||||
"baseUrl": "./",
|
||||
"types": [],
|
||||
"paths": {
|
||||
"dumon-geolocation": ["node_modules/dumon-geolocation/dist/esm"]
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user