Comments (8)
I am experiencing the same situation.
from ionic-geofence.
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.
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
andcordova-plugin-whitelist
- Add
<allow-navigation href="*://*.openstreetmap.org/*" />
or just<allow-navigation href="*" />
to yourconfig.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 thegeolocation plugin
will add those automatically but double check it.
Voilà your starter would start ;)
from ionic-geofence.
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.
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.
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.
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.
Closing due to inactivity.
from ionic-geofence.
Related Issues (20)
- Lib folder is missing HOT 1
- black page. Folder lib not found HOT 1
- Android build fails HOT 4
- Wont work on device HOT 4
- getbound() HOT 1
- ios not working HOT 4
- geofence circle not show HOT 1
- Angular Not Defined Error HOT 1
- Xcode 8, iOS 10 compatbility issue HOT 3
- Publish the example app in the app store? HOT 1
- Doesn't compile with latest tool chain HOT 2
- ionic run android fails HOT 3
- window.geofence is always undefined HOT 1
- Phonegap build error
- ionic-geofence notification is not working on iOS device/xcode simulator HOT 1
- Code not working HOT 2
- ENOENT error HOT 2
- upgrade to ionic3 HOT 1
- iOS notification issue
- G
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ionic-geofence.