Code Monkey home page Code Monkey logo

Comments (7)

caio-ribeiro-pereira avatar caio-ribeiro-pereira commented on May 17, 2024

Hi, I helped solve this issue, sending this PR (df1b174).
Please, update this package for version 1.0.3, and to solve your problem, you just need to run this code below to check if the GPS is turned on:

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!

from mobile-packages.

SylvainBigonneau avatar SylvainBigonneau commented on May 17, 2024

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.

from mobile-packages.

caio-ribeiro-pereira avatar caio-ribeiro-pereira commented on May 17, 2024

I didn't find a way to create a button for turn on gps, but if you find
please share with us!

Att,
Caio Ribeiro Pereira
Software Engineer
http://crpwebdev.com
On May 21, 2015 3:18 AM, "BraveKenny" [email protected] wrote:

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.


Reply to this email directly or view it on GitHub
#54 (comment)
.

from mobile-packages.

vinaypuppal avatar vinaypuppal commented on May 17, 2024

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

from mobile-packages.

dhavalrajani92 avatar dhavalrajani92 commented on May 17, 2024

Hello @vinaypuppal have you used with meteor? if yes than give me tarball url for installation or any example

from mobile-packages.

vinaypuppal avatar vinaypuppal commented on May 17, 2024

@dhavalrajani92 Yes I have used it working perfectly, here is the tarball url https://github.com/rodrigo-martinezd/cordova-dialog-gps.git#f1103143fcf725fb98be8af7cbf98383945225ab

from mobile-packages.

StorytellerCZ avatar StorytellerCZ commented on May 17, 2024

I'm closing this issue as it has been fixed.

from mobile-packages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.