用离子方法在真实设备上进行地理定位

时间:2018-02-01 11:52:00

标签: android cordova ionic-framework ionic2

如何在真实设备上调试地理定位制作离子应用程序? 我正在使用ionic cordova run android --device --livereload命令使用IP(而不是localhost),我收到Only secure origins are allowed.错误。

有没有办法在与USB连接的真实设备上调试应用程序?

获取职位的代码:

odswiezGps() {
    this.geolocation.getCurrentPosition({
        enableHighAccuracy: true
    }).then((resp) => {
        this.gps = resp;
        console.log(resp);
    }).catch((error) => {
        console.log('Error getting location', error);
    });
}

0 个答案:

没有答案
相关问题