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

RMET-3900 :: bridge :: add getCurrentPosition wrapper for both capacitor and cordova #1

Merged
merged 20 commits into from
Jan 6, 2025
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
2a99be8
feat: add wrapper as a package
OS-martacarlos Dec 19, 2024
1fa586f
refactor: avoid similar types
OS-martacarlos Dec 20, 2024
02e5c0a
feat(capacitor): add pwa getCurrentPosition
OS-martacarlos Dec 20, 2024
3988616
refactor(wrapper): adds UUIDs to wrapper
OS-martacarlos Dec 20, 2024
8340740
feat(capacitor): add pwa code
OS-martacarlos Dec 20, 2024
c02588c
fix: use plugin.xml as standard file, not link
alexgerardojacinto Dec 23, 2024
4fda383
fix: remove files that do not exist (yet)
alexgerardojacinto Dec 23, 2024
351b570
fix: fixing function name for `watchPosition` and `id field for clear…
alexgerardojacinto Dec 23, 2024
a1490e8
fix: convert position result for watchPosition like we do for getCurr…
alexgerardojacinto Dec 26, 2024
b39abe4
fix: include `watchId` in the parameters for `watchPosition in the co…
alexgerardojacinto Dec 26, 2024
a5eef58
chore: update README.md file
alexgerardojacinto Dec 27, 2024
02f470b
chore: fix typo in iOS library name
alexgerardojacinto Dec 27, 2024
86294d7
chore(cordova-plugin): update dist
OS-ricardomoreirasilva Dec 30, 2024
a0452bf
chore(js): create WatchPositionOptions structure
OS-ricardomoreirasilva Jan 2, 2025
283c740
chore: add success and error callbacks to clearWatch in outsystems-wr…
alexgerardojacinto Jan 3, 2025
be9b246
fix: add missing callbacks when calling clearWatch
alexgerardojacinto Jan 3, 2025
54a138c
fix: correctly pass options to clearWatch
alexgerardojacinto Jan 3, 2025
6ee6dc8
fix: correctly pass watchId to clearWatch
alexgerardojacinto Jan 3, 2025
741d72a
fix: correctly pass watchId to clearWatch
alexgerardojacinto Jan 3, 2025
2fcd073
fix: typos and remove unnecessary callback
OS-martacarlos Jan 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions packages/capacitor-plugin/src/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,25 @@ import { WebPlugin } from '@capacitor/core';
import type { CallbackID, ClearWatchOptions, GeolocationPluginPermissions, IGeolocationPlugin, PermissionStatus, Position, PositionOptions, WatchPositionCallback } from './definitions';

export class GeolocationPluginWeb extends WebPlugin implements IGeolocationPlugin {
getCurrentPosition(options?: PositionOptions): Promise<Position> {
throw new Error('Method not implemented.');
async getCurrentPosition(options?: PositionOptions): Promise<Position> {
return new Promise((resolve, reject) => {
navigator.geolocation.getCurrentPosition(
pos => {
resolve(pos);
},
err => {
reject(err);
},
{
enableHighAccuracy: false,
timeout: 10000,
maximumAge: 0,
...options,
OS-pedrogustavobilro marked this conversation as resolved.
Show resolved Hide resolved
},
);
});
}

watchPosition(options: PositionOptions, callback: WatchPositionCallback): Promise<CallbackID> {
throw new Error('Method not implemented.');
}
Expand Down