Git Product home page Git Product logo

Comments (26)

mehdok avatar mehdok commented on July 18, 2024 3

@MazEbeid @travisjayday The mentioned PR is merged and the problem should be solved in the latest version. Please Test last version and let me know if you have any problem.

from background_locator.

travisjayday avatar travisjayday commented on July 18, 2024 2

Yay it's working AFAICT! Even after the app is killed on iOS. Also managed to get Firebase/Firestore working in the callback, so that's awesome! Thanks for your amazing work guys 👍

from background_locator.

jbxbergdev avatar jbxbergdev commented on July 18, 2024 1

@mehdok I read through this thread and am still not quite sure as how to handle the app being killed by the iOS system correctly. As far as I understand, some further actions are required for iOS? Can you (or somebody else on here) please explain these steps, or even better, add them to the plugin docs?

from background_locator.

jbxbergdev avatar jbxbergdev commented on July 18, 2024 1

Yay it's working AFAICT! Even after the app is killed on iOS. Also managed to get Firebase/Firestore working in the callback, so that's awesome! Thanks for your amazing work guys 👍

@travisjayday can you please explain how you got Firebase working in the callback, in the case the app was killed? Thanks.

from background_locator.

mehdok avatar mehdok commented on July 18, 2024

There is no need for notification on iOS.

The idea for iOS is that when app is killed and new location received the os should wake the app and execute some code and then kill the app again. After this if you open the app you should see that locations is saved. If it's not the behavior you get there might be a bug;

from background_locator.

martofeld avatar martofeld commented on July 18, 2024

I believe it's not the behavior, I left the app killed for hours and haven't gotten any new locations, at least none that are saved via the FileManager. I've been testing mostly using the example app provided in this repo.

Might be related but given that we are in quarantine I haven't moved much this past few days. As far as I understand this uses the significant location API from Apple.

from background_locator.

pkuzco avatar pkuzco commented on July 18, 2024

I tested both on an emulator and a real device. doesn't work on either.

I found one issue in this code:
https://github.com/rekab-app/background_locator/blob/master/ios/Classes/BackgroundLocatorPlugin.m#L93

I think you should call startMonitoringSignificantLocationChanges again before returning from didFinishLaunchingWithOptions, but I doubt this is the only issue that causes this feature not to work.

This plugin seems to have a complete implementation, but I haven't tested that:
https://github.com/rmtmckenzie/flutter-plugins/blob/master/packages/location_background/ios/Classes/LocationBackgroundPlugin.m#L32-L60

from background_locator.

martofeld avatar martofeld commented on July 18, 2024

@pkuzco I took a look at the one you sent but doesn't seem to be working. It crashes in background when the location is updated. I've been working on trying to integrate their code in this plugin but unfortunately my iOS is not strong enough.

from background_locator.

martofeld avatar martofeld commented on July 18, 2024

@mehdok Do you happen to have any ETAs on fixing this bug? This is the best library I've found so far for background location but this bug renders it unusable in iOS

from background_locator.

alexlopespereira avatar alexlopespereira commented on July 18, 2024

@mehdok I'm on a similar situation that @martofeld is on. I might have to migrate to another plugin because I can not use this plugin on iOS.

from background_locator.

mehdok avatar mehdok commented on July 18, 2024

@martofeld @alexlopespereira I'm trying my best to fix this bug a.s.a.p . In the meaning while any PR or suggestions are very welcome.

from background_locator.

martofeld avatar martofeld commented on July 18, 2024

@mehdok that is great news!! I would love to help but unfortunately iOS is not my strong suite. I did test the plug-in that was linked earlier in the comments and it does seem to work.

from background_locator.

ellie avatar ellie commented on July 18, 2024

I'll check this out! I have some experience with location tracking stuff on iOS, and I kinda really need this functionality haha

from background_locator.

martofeld avatar martofeld commented on July 18, 2024

@elliebike @mehdok I've been thinking a lot about this lately. As far as I can tell, the only Location operations you can do while the app is in background is significantChangesMonitoring which would mean your app gets restarted to let you know the users location (but only every 500m).

I also read that the CLLocationManager can do Region Monitoring (geofencing?) and I'm not sure if that will ran while the app is killed, but if it were to run it would be a great possibility to obtain locations over smaller distance changes. It would probably require to unregister the old location and register a new Region based of the last location every time we get a new event.

Does any of you think that is something feasible?

from background_locator.

martofeld avatar martofeld commented on July 18, 2024

Created #59 as a possible fix following my previous comment

from background_locator.

mohamnag avatar mohamnag commented on July 18, 2024

18 Days, a PR ready to go but no feedback :-(

from background_locator.

neetable-chollarasan avatar neetable-chollarasan commented on July 18, 2024

any update on this. still, I am not getting the location after an app killed

from background_locator.

mehdok avatar mehdok commented on July 18, 2024

@chollarasan There is a little problem with mentioned PR that need to be addressed before merging.

from background_locator.

MazEbeid avatar MazEbeid commented on July 18, 2024

This is by far one of the most complete and useful plugins out there - but iOS background location updates are quite important - are you making progress on this front? @mehdok

from background_locator.

travisjayday avatar travisjayday commented on July 18, 2024

Any updates on this? Did the PR ever get merged to fix this? I'd love to help too because I kinda really need iOS background location updates but I'm a noob when it comes to native iOS. Does it work yet?

from background_locator.

travisjayday avatar travisjayday commented on July 18, 2024

Thanks @mehdok, will test and report back.

from background_locator.

zgosalvez avatar zgosalvez commented on July 18, 2024

@mehdok / @travisjayday, how were you able to verify? I don't think iOS is launching the app in the background after quitting the app. But I can confirm the plugin works if the app is running/background.

from background_locator.

mehdok avatar mehdok commented on July 18, 2024

@zgosalvez
You can set the callback to write new locations to shared preferences, then after you kill the app and relaunch it you can see that there are some locations that received when the app was killed;

Besides this, you can see a small arrow in the status bar whenever a new location is coming;

from background_locator.

zgosalvez avatar zgosalvez commented on July 18, 2024

@mehdok, I'll try that. Right now I'm using Console to see if the process is relaunched but it doesn't look like it. I can confirm tho that it subscribe to region monitoring via the logs.

Client ... is subscribing to notification kCLConnectionMessageRegionMonitoring

I set my distanceFilter to 1.0 in hopes of getting a log/local notification just by moving around the house. Or should I move farther? The weird thing is, I don't actually have to move when the app is running to get a log/local notification from my callback.

from background_locator.

mehdok avatar mehdok commented on July 18, 2024

1-meter distance filter is pretty good, iOS is really accurate in this case;

The weird thing is, I don't actually have to move when the app is running to get a log/local notification from my callback.

I'm not sure, but I think iOS will try to conserve energy at least when your app is terminated, so it is normal that you receive less location update in that case;

from background_locator.

insoon0930 avatar insoon0930 commented on July 18, 2024

@mehdok i just found out that latest version(1.6.6) example doesn't work in IOS when app is killed... (it works in android perfectly) Reading this issue, seems like you guys solved it, but is there anything else i need to do to use it? I'm confused because it doesn't work...

from background_locator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.