Geolocation.latLng () does not work in android

I use the mdg:geolocation package and I try to run it on an Android device, but I no longer get lat and lang, when I tried this a few months ago, it works fine

I am using the version of this package version 1.0.3 *

enter image description here

chrome throws above warning which leads me to this page

as this is a warning that should work.

I even tried to run the application by providing --mobile-server=https://myapp.com not yet working.

any ideas?

My meteor version is 1.1. * (not the last) geolocation - 1.0.3

EDIT

I tried using the navigator object as shown below

 var onSuccess = function(position) { console.log('Latitude: ' + position.coords.latitude + '\n' + 'Longitude: ' + position.coords.longitude + '\n' + 'Altitude: ' + position.coords.altitude + '\n' + 'Accuracy: ' + position.coords.accuracy + '\n' + 'Altitude Accuracy: ' + position.coords.altitudeAccuracy + '\n' + 'Heading: ' + position.coords.heading + '\n' + 'Speed: ' + position.coords.speed + '\n' + 'Timestamp: ' + position.timestamp + '\n'); }; // onError Callback receives a PositionError object // function onError(error) { console.log('code: ' + error.code + '\n' + 'message: ' + error.message + '\n'); } navigator.geolocation.getCurrentPosition(onSuccess, onError); 

I did not have any logs in the console. Errors or successful callbacks are called

EDIT 2 :

This does not work when running my application on an Android mobile phone. If I run it on the Internet, I get lat and lang values.

EDIT 3

I am building an apk with --server pointing to https://myapp.com , but this does not work.

EDIT 4

I have another project with all the latest version, all of the above steps still don't work (even with apk build version)

EDIT 5

After trying @Adam I get the following error

code: 3 message: Timeout expired

tried another option with timeout , enablehighaccuracy and maxage while nothing works.

+7
cordova meteor
source share
2 answers

With the Android emulator, you may need to first indicate the position. So run something like:

~/.meteor/android_bundle/android-sdk/platform-tools/adb emu geo fix <longitude value> <latitude value>

+2
source share

Are you coping with your problem? I was available for work using

 var geo_err = Geolocation.error(); if(geo_err != null) alert(geo_err.message); var pos = Geolocation.latLng(); if(pos == null) return false; 

You need to put him in an assistant, because he needs to sort it out, waiting for an answer, otherwise there will always be an error. I use the button to change the Session varible state, which the assistant later activates, so it can be called more than once. I hope for help, I tested on Android and chrome and worked. The only problem was that I can not get the user to request permission, if gps is not activated, it gives me

Timeout Error So ... looking forward to it.

+1
source share

All Articles