GithubHelp home page GithubHelp logo

Comments (8)

dylboy avatar dylboy commented on June 27, 2024

I am experiencing the same situation.

from ionic-geofence.

tsubik avatar tsubik commented on June 27, 2024

Hey application uses cordova-plugin-geolocation for getting current position. Looks like somehow it cannot get position and I just found out that default timeout is inifite! which is insane. I set timeout explicity to 10sec.

from ionic-geofence.

adyba avatar adyba commented on June 27, 2024

OK I think I got it. The code seems to be OK, but there is total mess in plugins and permissions.
The repo was created with Cordova <v4, standard Ionic project has /plugins in .gitignore, thus clones people have on their computers don't have all (or uptodate) plugins.
My solution:

  • Update the Cordova
  • Manually reinstall all the cordova plugins mentioned in config.xml
  • Make sure you have installed cordova-plugin-geolocation and cordova-plugin-whitelist
  • Add <allow-navigation href="*://*.openstreetmap.org/*" /> or just <allow-navigation href="*" /> to your config.xml
  • Make sure your /platforms/android/AndroidManifest.xml contains those lines <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> and <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />. I believe the installation of the geolocation plugin will add those automatically but double check it.

Voilà your starter would start ;)

from ionic-geofence.

dylboy avatar dylboy commented on June 27, 2024

HI @adyba ,
Tried all this. I didnt however remove plugins before reinstalling (Did you remove 1st?)
I am using cordova 5.3.3.
My issue is when adding a new location the map never loads?

It used to just hang on modal.Now modal goes but map never comes.
ANy ideas?

from ionic-geofence.

adyba avatar adyba commented on June 27, 2024

Just a remote guess ... I have also had a problem to load leaflet maps from openstreetmap.org. Above some version of Cordova you have to allow remote IP adresses/data sources. Thus there is necessary to install cordova-plugin-whitelist and inside config.xml define what resources should be "open" (see my 4th bullet). href="*://*.openstreetmap.org/* basicaly says consume everything from openstreetmap.org. I found this requirement in my Chrome console.
The <allow-navigation href="*" /> is just ONE BIG wildcard that condone everything (not very safe).
Good luck ;)

P.S. The geofence plugin was present. To be honest I don't remember whether I reainstalled it or not. The current versions of plugins use to have a 'slash notation' like plugin-name instead of plugin.name

from ionic-geofence.

tsubik avatar tsubik commented on June 27, 2024

We don't need any allow-navigation if I have good understanding of cordova-plugin-whitelist documentation. We need <access origin="*.openstreetmap.org"/> for webviews which don't support CSP and also I've added CSP meta tag.

from ionic-geofence.

adyba avatar adyba commented on June 27, 2024

You maid be right but the access origin would potentially need a propper Cordova hook setting which is actually what I'm trying to avoid in order to get our clones as close as it gets to the environmet on your desktop. As the navigation is subset of access and it is already present and set up in a Ionic app I believe Its OK to use it while it is not totally wild wildcard.

from ionic-geofence.

tsubik avatar tsubik commented on June 27, 2024

Closing due to inactivity.

from ionic-geofence.

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.