-
Notifications
You must be signed in to change notification settings - Fork 362
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] Doesn't work on app killed #54
Comments
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; |
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. |
I tested both on an emulator and a real device. doesn't work on either. I found one issue in this code: I think you should call This plugin seems to have a complete implementation, but I haven't tested that: |
@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. |
@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 |
@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. |
@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. |
@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. |
I'll check this out! I have some experience with location tracking stuff on iOS, and I kinda really need this functionality haha |
@elliebike @mehdok I've been thinking a lot about this lately. As far as I can tell, the only I also read that the Does any of you think that is something feasible? |
Created #59 as a possible fix following my previous comment |
18 Days, a PR ready to go but no feedback :-( |
any update on this. still, I am not getting the location after an app killed |
@chollarasan There is a little problem with mentioned PR that need to be addressed before merging. |
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 |
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? |
@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. |
Thanks @mehdok, will test and report back. |
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 👍 |
@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. |
@zgosalvez Besides this, you can see a small arrow in the status bar whenever a new location is coming; |
@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.
I set my |
1-meter distance filter is pretty good, iOS is really accurate in this case;
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; |
@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? |
@travisjayday can you please explain how you got Firebase working in the callback, in the case the app was killed? Thanks. |
@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... |
I downloaded the project and tested it against the provided example app. I installed it in a real iOS device and started it. Started getting a few sparse location, went to background and the project didn't show any notification but still got a few updates. As soon as you kill the app it stops.
Other info:
Had to get some work done according to the iOS migration guide to get it to work with XCode 11
Tested with
iPhone XR - 13.4.1
The text was updated successfully, but these errors were encountered: