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

[ios] Set correct location service activity type for cycling #8220

Merged
merged 1 commit into from
May 20, 2024

Conversation

biodranik
Copy link
Member

CLActivityTypeOtherNavigation
The value that indicates positioning for activities that don’t or may not adhere to roads such as cycling, scooters, trains, boats and off-road vehicles.

CLActivityTypeFitness
The value that indicates positioning during dedicated fitness sessions, such as walking workouts, running workouts, cycling workouts, and so on.

Note that in the current car navigation mode position will be closer to Apple's road network data:

CLActivityTypeAutomotiveNavigation
The value that indicates positioning in an automobile following a road network.

Copy link
Member

@vng vng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes are opposite to the PR's description. Or I missed something?

@vng
Copy link
Member

vng commented May 19, 2024

Or if we prefer "Other" for bicycle, pedestrian should also be "Other", according to the description ..

CLActivityTypeFitness

This activity might cause the system to pause location updates when the user doesn’t move a significant distance over a period of time.
The system disables indoor positioning.

Signed-off-by: Alexander Borsuk <me@alex.bio>
@biodranik
Copy link
Member Author

@vng good point, agree. Updated the PR to drop fitness. @kirylkaveryn documentation says that location updates may be stopped in some conditions. Does our current implementation properly resumes these updates after they have been stopped? Because if not, it may cause #799

@kirylkaveryn
Copy link
Contributor

kirylkaveryn commented May 19, 2024

I'm not sure about this change.

Documentation says that other may pause location updates too.

This activity might cause the system to pause location updates when the vehicle doesn’t move a significant distance over a period of time.

https://developer.apple.com/documentation/corelocation/clactivitytype/clactivitytypeothernavigation?language=objc

Pausing updates doesn't mean "stopping" - that location is disabled. It means that if you having a rest, location will not be updated until you continue walking/biking.

Location always starts updating when a user continues activity. I haven't faced any issues with that.

Some articles says that Fitness type is more precise.
Maybe the Other will be enough. But as Apple said:

pedestrian navigation tracking that’s not tied to a road network, paths, or trails.

During the biking and hiking it's usually important to tie to the dedicated path...

@biodranik
Copy link
Member Author

biodranik commented May 19, 2024

During the biking and hiking it's usually important to tie to the dedicated path...

Our users do not walk on Apple-approved paths. They use OSM paths, and often go where there are no any paths )

Pausing is ok to save battery, it is important to restart again though )

Aren't docs say that location updates should be restarted manually?

After a pause occurs, it’s your responsibility to restart location services again when you determine that they’re needed. Core Location calls the locationManagerDidPauseLocationUpdates: method of your location manager’s delegate to let you know that a pause has occurred. In that method configure a local notification that has a UNLocationNotificationTrigger to notify when the user exits the current region. The message for the local notification should prompt the user to launch your app again so that it can resume updates.

@biodranik biodranik merged commit 2098646 into master May 20, 2024
5 checks passed
@biodranik biodranik deleted the ab-ios-cycling-activity branch May 20, 2024 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants