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

Fixes a bug where iOS location settings, e.g. accuracy and distanceFilter are overridden by different calls #1600

Merged
merged 2 commits into from
Nov 14, 2024

Conversation

ksenia-lyagusha
Copy link
Contributor

@ksenia-lyagusha ksenia-lyagusha commented Nov 6, 2024

Fixes a bug where iOS location settings, e.g. accuracy and distanceFilter are overridden by different calls
Fixes this comment in the thread #1116 (comment) and probably the whole ticket #1116

  • Uses different CLLocationManager instances, for one time request location and persistent request location.
  • Switches to new [CLLocationManager requestLocation] method for one time location.
  • Fixes a bug where iOS location settings, e.g. accuracy and distanceFilter are overridden by different calls.
  • Updates minimum deployment target to iOS 11 as lower is not supported anymore by Xcode.

Pre-launch Checklist

  • I made sure the project builds.
  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is does not need version changes.
  • I updated CHANGELOG.md to add a description of the change.
  • I updated/added relevant documentation (doc comments with ///).
  • I rebased onto main.
  • I added new tests to check the change I am making, or this PR does not need tests.
  • I made sure all existing and new tests are passing.
  • I ran dart format . and committed any changes.
  • I ran flutter analyze and fixed any errors.

…eFilter` are overridden by different calls
@ksenia-lyagusha
Copy link
Contributor Author

@mvanbeusekom Can someone take a look at the PR? Or what's the flow to be merged into master?

@mvanbeusekom
Copy link
Member

Hi @ksenia-lyagusha,

Thank you for submitting this PR. Would you mind reverting the changes to the geolocator package and create a separate PR for those? That way I can publish the packages independent from each other.

Also please revert the changes for the requestLocation API. We have used it in the past but turns out that it is very slow and we got a lot of complaints, that is why we use the startLocationUpdate in stead.

…r those.

Revert the changes for the requestLocation API. Now use separate oneTimeLocationManager with startUpdatingLocation logic.
Reverted and updated tests.
@ksenia-lyagusha
Copy link
Contributor Author

@mvanbeusekom I updated PR, can you please review it then I create a second PR with updating example to the main geolocator package?

Copy link
Member

@mvanbeusekom mvanbeusekom left a comment

Choose a reason for hiding this comment

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

@ksenia-lyagusha thank you for applying the feedback. I think this looks great!

@mvanbeusekom mvanbeusekom merged commit 6a226c8 into Baseflow:main Nov 14, 2024
1 check passed
@mvanbeusekom
Copy link
Member

I have just published the update to pub.dev, version 2.3.8 of the geolocator_apple package should now be available.

@ksenia-lyagusha
Copy link
Contributor Author

@mvanbeusekom Thank you. Created a new PR (#1605) with updated version.

@SebastianKeller
Copy link
Contributor

SebastianKeller commented Nov 14, 2024

I believe this PR is causing a crash on iOS:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[GeolocationHandler stopListening]: unrecognized selector sent to instance 0x300613f80'

GeolocationHandler.m does no longer implement - (void)stopListening;.

image

@mvanbeusekom
Copy link
Member

Hi @SebastianKeller,

Thank you for reporting this. The stopListening method was indeed not implemented correctly, I've published version 2.3.8+1 containing a hot fix for this mistake.

@SebastianKeller
Copy link
Contributor

Hi @mvanbeusekom, that was fast :)

I can confirm, 2.3.8+1 is no longer crashing. Thank you!

@Sander-Kornev
Copy link

Hi @mvanbeusekom
I've added PR to switch to version 2.3.8+1 #1607

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.

4 participants