Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Ionic 2 Beta / Geolocation plugin not working

$
0
0

It seems that the geolocation wrappers have been removed.

I ended up wrapping the cordova call into a promise:

    var p = new Promise(function(resolve, reject) {
        var options = {timeout: 10000, enableHighAccuracy: true};
        navigator.geolocation.getCurrentPosition(function (position) {
            resolve(position);
        }, function (err) {
            reject(err);
        }, options);
    });

Viewing all articles
Browse latest Browse all 228595

Trending Articles