ฉันมีปัญหากับ ปลั๊กอิน GeoLocation ที่ ionic3
ฉันเพิ่มของนำเข้าทั้งหมดแล้ว ส่วน <edit-config>
ก็เช่นกัน ฉันเห็นสิ่งนี้ในไฟล์ plist ของฉัน:
<key>NSLocationWhenInUseUsageDescription</key>
<string>Get Position</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Get position</string>
ดังนั้นฉันคิดว่ามันได้ผล แต่มันไม่ใช่; มันใช้งานได้กับ Android แต่ไม่ใช่สำหรับ iOS ฉันเรียกวิธีนี้:
this.geolocation.getCurrentPosition().then((resp) => {
alert("geo " + resp.coords.latitude);
// resp.coords.latitude
// resp.coords.longitude
}).catch((error) => {
alert(error.code);
alert(error.message);
});
ฉันได้รับ Error.code 2 และ Error.message: "Origin is not have allowance to use Geolocation service"
ฉันควรทำอย่างไรดี?