-
Notifications
You must be signed in to change notification settings - Fork 587
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
feat(geolocation): add interval option in watch position #1756
base: main
Are you sure you want to change the base?
Conversation
7585176
to
432c6d7
Compare
geolocation/src/definitions.ts
Outdated
@@ -52,7 +52,7 @@ export interface GeolocationPlugin { | |||
* @since 1.0.0 | |||
*/ | |||
watchPosition( | |||
options: PositionOptions, | |||
options: WatchPositionOptions, |
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'm not sure I need to add a new interface here.
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.
Not really, you can just add the new options to the existing interface.
.setMaxUpdateDelayMillis(timeout) | ||
.setMinUpdateIntervalMillis(5000) |
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.
Obviously it has to be removed.
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.
This probably should be made another option along with interval, and have it default to 5000.
432c6d7
to
1d8240c
Compare
geolocation/android/src/main/java/com/capacitorjs/plugins/geolocation/GeolocationPlugin.java
Outdated
Show resolved
Hide resolved
.setMaxUpdateDelayMillis(timeout) | ||
.setMinUpdateIntervalMillis(5000) |
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.
This probably should be made another option along with interval, and have it default to 5000.
geolocation/src/definitions.ts
Outdated
@@ -52,7 +52,7 @@ export interface GeolocationPlugin { | |||
* @since 1.0.0 | |||
*/ | |||
watchPosition( | |||
options: PositionOptions, | |||
options: WatchPositionOptions, |
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.
Not really, you can just add the new options to the existing interface.
1d8240c
to
33bcc06
Compare
1edf337
to
639daf3
Compare
I have just updated this pull request. |
@@ -68,7 +68,7 @@ public void sendLocation(boolean enableHighAccuracy, final LocationResultCallbac | |||
} | |||
|
|||
@SuppressWarnings("MissingPermission") | |||
public void requestLocationUpdates(boolean enableHighAccuracy, int timeout, final LocationResultCallback resultCallback) { | |||
public void requestLocationUpdates(boolean enableHighAccuracy, long timeout, long interval, long minInterval, final LocationResultCallback resultCallback) { |
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.
Using long type seems to be better as LocationRequest.Builder
accepts long arguments.
geolocation/android/src/main/java/com/capacitorjs/plugins/geolocation/GeolocationPlugin.java
Show resolved
Hide resolved
639daf3
to
74fc8a3
Compare
3da7c72
to
99c8958
Compare
99c8958
to
28375bc
Compare
Can i do anything to get this merged ? |
28375bc
to
d9bb366
Compare
d9bb366
to
dca1705
Compare
Hello, will this pull request be merged soon? |
dca1705
to
5fb2e57
Compare
This follow up #1619 and #1465