-
Notifications
You must be signed in to change notification settings - Fork 153
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
[Android] Turning GPS on while app is running does not work? #54
Comments
Hi, I helped solve this issue, sending this PR (df1b174). Template.gps.helpers({
hasGPS: function() {
return !!Geolocation.error();
}
}); and in your template use this snippet: <template name="gps">
{{#if hasGPS}}
<h1>GPS online!</h1>
{{else}}
<h1>GPS offline, turn the gps on and <a href="#" onclick="window.location.reload();">reload the app</a>.</h1>
{{/if}}
</template> Now there is a timeout of 10 seconds checking if the GPS is on, if not it throws error. This code runs on mobile too. I hope this code can help you! |
Thanks a lot! That solves the detection problem! Now we only need to find a way to not ask the user for a manual reload, as any production app would not. |
I didn't find a way to create a button for turn on gps, but if you find Att,
|
Hope this might be helpful to who reach here with this GPS problem. Plugin for phonegap/cordova to display a dialog and redirect to GPS settings when the GPS is disable. https://github.com/rodrigo-martinezd/cordova-dialog-gps |
Hello @vinaypuppal have you used with meteor? if yes than give me tarball url for installation or any example |
@dhavalrajani92 Yes I have used it working perfectly, here is the tarball url https://github.com/rodrigo-martinezd/cordova-dialog-gps.git#f1103143fcf725fb98be8af7cbf98383945225ab |
I'm closing this issue as it has been fixed. |
I do no know if it is in the scope of this project, but when I start up, say, simple-map on my Android phone with the GPS turned off, and only then turn the GPS on while the app is running, meteor is unable to catch that activation. (also, the geolocation icon does not appear in the status bar, unless I am using another geolocation app in the background)
Only if I press the back button does it "reload" the app and then it works, and the geolocation icon appears. It also works if I have GPS turned on prior to launching the app.
Is there a way to detect GPS activation within the meteor app? Or should I put a "check again" button on my app that does ̀window.location.reload()` ?
The text was updated successfully, but these errors were encountered: