Comments (26)
@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.
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.
@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.
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.
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.
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.
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.
@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.
@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.
@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.
@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.
@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.
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.
@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.
Created #59 as a possible fix following my previous comment
from background_locator.
18 Days, a PR ready to go but no feedback :-(
from background_locator.
any update on this. still, I am not getting the location after an app killed
from background_locator.
@chollarasan There is a little problem with mentioned PR that need to be addressed before merging.
from background_locator.
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.
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.
Thanks @mehdok, will test and report back.
from background_locator.
@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.
@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.
@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.
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.
@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)
- How can I send data from location callback to controller? HOT 1
- location_callback_handler.dart not found when run release project HOT 5
- [ERROR:flutter/shell/common/shell.cc(93)] Dart Error: Dart_LookupLibrary: library 'package:untitled/location_callback_handler.dart' not found. HOT 4
- Unable to build flutter release version with background_locator lastest HOT 1
- Library Update
- Issue on release build HOT 8
- Unable to capture location in release mode (Android) HOT 4
- Unable to run on iOS
- Error java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.location.FusedLocationProviderClient HOT 1
- Error on init app flutter with carp_background_location HOT 5
- java.lang.IncompatibleClassChangeError: The method 'com.google.android.gms.tasks.Task com.google.android.gms.location.FusedLocationProviderClient.requestLocationUpdates(com.google.android.gms.location.LocationRequest, com.google.android.gms.location.LocationCallback, android.os.Looper)' was expected to be of type virtual but instead was found to be of type interface (declaration of 'rekab.app.background_locator.provider.GoogleLocationProviderClient' appears in /data/app/com.doa.lojisoft.saray-JqLCd0a12SEpAYQu6cUZjg==/base.apk:classes2.dex) HOT 2
- Service stopped suddenly in release mode android
- Data type mismatch (nullable type) and method implementation error in kotlin code just after adding the dependency HOT 1
- [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument: is a regular instance: Instance of 'LocationDto'
- What is speed measured in?
- How to stop service after a period of time?
- Upgrade Background_Locator
- Need Code or Library in kotlin only
- I so confused about "getting location updates even when the app is killed" !!!!
- Is it still maintained? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from background_locator.