2
私はionic2でgeolocationプラグインを使用しています。アプリがブラウザに読み込まれると、許可が求められます。しかし、getcurrentpositionが呼び出されたときの位置を取得しません。私はFireFoxブラウザを使用します。ionic2:ブラウザのジオロケーションがエラーで失敗する:例外:未知(約束):偽
コンソールログには、エラーを示しています
EXCEPTION: Uncaught (in promise): false
私は別の関数が利用可能な場合はnull getcurrentlocation呼び出しの成功または失敗に基づいて位置を渡す必要があります。ここで
は、コードスニペットです:public test(){
Geolocation.getCurrentPosition().then((resp) => {
console.log (resp.coords.latitude);
console.log (resp.coords.longitude);
this.callclockin(resp.coords.latitude, resp.coords.longitude);
}).catch((error) => {
this.callclockin("", "");
});
}