[英]ios 11 no GPS request
現在我已經更新到ios 11,因此地理定位請求在我的iPhone上可以正常工作了,它不再彈出允許訪問GPS位置的提示。
if (Geolocation.permissionStatus == "unknown" && Geolocation.isSupported == true){
GPS.addEventListener(PermissionEvent.PERMISSION_STATUS, gpsPermission);
GPS.requestPermission();
經過研究,顯然我可能需要在xml中包含一些內容以允許iPhone的權限。 如果我進入設置並在其中啟用GPS,則該應用程序可以很好地運行GPS,只有權限請求無效。
更新后,我的應用程序圖標也不再顯示在菜單中。
謝謝
好的,所以在ios 11之前,我不需要為iPhone添加任何按鍵,但是在ios 11中,您需要添加任何按鍵。
<key>NSLocationAlwaysUsageDescription</key>
<string>Sample description to allow geolocation always</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Sample description to allow geolocation when application is in foreground</string>
我嘗試了這些,但沒有彈出請求。 我需要的是:
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Sample description to allow geolocation always and when application is in foreground</string>
不知道為什么,但是這解決了問題。 如果有人願意詳細說明,我將不勝感激。 也許iPhone只是希望用戶能夠做出自己的選擇。
謝謝你的時間
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.