-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: development
Are you sure you want to change the base?
Conversation
export type OSGLOCPosition = { | ||
timestamp: number; | ||
latitude: number; | ||
longitude: number; | ||
accuracy: number; | ||
altitude: number | null; | ||
speed: number | null; | ||
heading: number | null; | ||
altitudeAccuracy: number | null; | ||
}; | ||
export type LegacyOSPosition = { | ||
timestamp: number; | ||
latitude: number; | ||
longitude: number; | ||
accuracy: number; | ||
altitudeAccuracy: number | null | undefined; | ||
altitude: number | null; | ||
velocity: number | null; | ||
heading: number | null; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need both? They are identical so I was wondering if we could reuse one of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be fixed!
81e3eb1
to
1fa586f
Compare
if (this.#lastPosition && options.maximumAge && (((new Date()).getTime() - this.#lastPosition.timestamp) <= options.maximumAge)) { | ||
success(this.#lastPosition); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this was taken from how the cordova plugin was setup - but On Android, this logic is being managed by the actual FusedLocationProviderClient. I don't know how it is on iOS, but if there is analagous logic, perhaps there is no need to store the lastPosition
in this wrapper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked with @OS-ricardomoreirasilva and iOS does not have this logic, so it needs to exist here
Description
This PR provides a wrapper to the plugin, adding timeout logic for
getCurrentPosition
.The main goal is to use this code inside the OutSystems Plugin, but it can also be used outside of it. I
As it already uses
CapacitorUtils.Synapse
it's ready for both cordova and capacitor plugins.It can also detect if an old build of the plugin is being used (aka the old
cordova-geolocation-plugin
)Type of changes
Platforms affected
Screenshots (if appropriate)
Checklist
RNMT-XXXX <title>