flutter-geolocator icon indicating copy to clipboard operation
flutter-geolocator copied to clipboard

Location stream if the app is kill

Open michaelnabil230 opened this issue 3 years ago • 2 comments

🚀 Feature Requests

We need some modifications to the package to support this feature because it is definitely useful for some people.

Platforms affected (mark all that apply)

  • [x] :iphone: iOS
  • [x] :robot: Android

michaelnabil230 avatar Sep 20 '22 19:09 michaelnabil230

In Apple's system, there is an action called startMonitoring and it works when the user moves every 500 meters only, and I think so is for Apple's privacy policy.

michaelnabil230 avatar Sep 20 '22 19:09 michaelnabil230

In the Android system, it supports this thing easily, but we need someone who is capable in that to add it to the hood without raising anything.

michaelnabil230 avatar Sep 20 '22 19:09 michaelnabil230

This should already work. Do you have some code or an example?

JulianBissekkou avatar Oct 18 '22 08:10 JulianBissekkou

Hi @JulianBissekkou,

I'm not a swift programmer but I've been a bit researched and I've decided to write this simple code to fetch the current site if the app is permanently locked from the background.

I send a request on API mocking so I can check whether it works or not and I see that it is working well.

But sometimes when you install the application for the first time, you are not asked to take the site in the background, I think this is related to the code and there is a solution if we search well.

Can see my result in my repo on GitHub (https://github.com/michaelnabil230/background-location)

michaelnabil230 avatar Oct 18 '22 15:10 michaelnabil230

When you lock the simulator and run, you will see that message to allow the application to run in the background and send your location. Screen Shot 2022-10-18 at 6 08 05 PM

michaelnabil230 avatar Oct 18 '22 16:10 michaelnabil230

When you change it to always allow, everything will work well

michaelnabil230 avatar Oct 18 '22 16:10 michaelnabil230

Dear @michaelnabil230 ,

It seems that this issue has been resolved. Therefore I close this issue. Feel free to reopen the issue if you have some additional information.

Kind regards,

TimHoogstrate avatar Aug 14 '23 13:08 TimHoogstrate