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

[Question]Location on or off manually #90

Open
heinzan opened this issue Jun 22, 2020 · 8 comments
Open

[Question]Location on or off manually #90

heinzan opened this issue Jun 22, 2020 · 8 comments

Comments

@heinzan
Copy link

heinzan commented Jun 22, 2020

[Question]how check gps is on or off.My problem is when user is manually off his location how detect it and inform him.Thanks

@xnio94
Copy link

xnio94 commented Aug 13, 2020

@heinzan did you find a solution?

@anirudhsharma392
Copy link

anirudhsharma392 commented Aug 15, 2020

First of all thanks a lot for this plugin.
Is there any tweak so that I can get gps status using this plugin only.
Otherwise I need to execute other process in the background for fetching up GPS status of mobile.

@mehdok
Copy link
Collaborator

mehdok commented Aug 17, 2020

There is no way to get gps status with this plugin, I believe there are more than one plugin out there to do this task for you. If you have any problem running other plugins in callback please refer to this wiki;

@anirudhsharma392
Copy link

ok, thanks though.

@anirudhsharma392
Copy link

@mehdok there are several plugins available to know the GPS status but I cannot call them in a callback. Since callback will not be called if GPS is turned off !!
@heinzan, @xnio94 did you guys sort it out ?

@xnio94
Copy link

xnio94 commented Aug 21, 2020

i used a combination of other packages to achieve the same thing :

  • i used flutter_foreground_plugin to run a callback every 5 seconds.
    using a foreground service means that a notification needs to be always showing in the tray, after a lot of research I learned its the best way to guarantee that the work will be done in the background, otherways the OS may prevent it (there is a lot of details here but in my case, that was the best solution)
  • the callback use geolocation to check GPS status and get the location.
  • if GPS is disabled notify the user using flutter_local_notifications
  • if its enabled do some work in my case (log the location into a database)

i still have some problems when the app is killed by the user. the plugin flutter_foreground_plugin did not work even if a notification still showing in the background

@anirudhsharma392 i hope this help otherwise I will try to assemble everything in a single package later (after finishing my current project) because I tried multiple packages but all of them didn't do the job out of the box and I don't see how to improve on top of them without major changes
there is also a paid option but it cost no less than 329$

@mehdok
Copy link
Collaborator

mehdok commented Aug 21, 2020

@anirudhsharma392
The callback is doing what it soppose to do. Callback is getting called When a new location point is available. You are turning the gps off and there is not any new location point and callback is not getting called.

I know you have truble getting gps status and it's a nice feature to have in library. I would appreaciate if you could create a PR and add this feature.

@anirudhsharma392
Copy link

@xnio94 thanks for your suggestion, I will try to follow the steps you mentioned.
@mehdok nothing wrong with the package. It's working great, actually better than all the other packages available for this purpose. I think we can close this issue and create a new request for this feature (maybe in a todo list) and also I will try to add this feature if the time allows.

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

No branches or pull requests

4 participants