久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <legend id='39irp'><style id='39irp'><dir id='39irp'><q id='39irp'></q></dir></style></legend>
      • <bdo id='39irp'></bdo><ul id='39irp'></ul>
      <tfoot id='39irp'></tfoot>
    1. <i id='39irp'><tr id='39irp'><dt id='39irp'><q id='39irp'><span id='39irp'><b id='39irp'><form id='39irp'><ins id='39irp'></ins><ul id='39irp'></ul><sub id='39irp'></sub></form><legend id='39irp'></legend><bdo id='39irp'><pre id='39irp'><center id='39irp'></center></pre></bdo></b><th id='39irp'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='39irp'><tfoot id='39irp'></tfoot><dl id='39irp'><fieldset id='39irp'></fieldset></dl></div>

    2. <small id='39irp'></small><noframes id='39irp'>

      將從應用程序獲取的地理位置傳遞給 UIWebView

      Passing geolocation fetched from the app to the UIWebView(將從應用程序獲取的地理位置傳遞給 UIWebView)
        <tbody id='gmefP'></tbody>
        <bdo id='gmefP'></bdo><ul id='gmefP'></ul>

                <legend id='gmefP'><style id='gmefP'><dir id='gmefP'><q id='gmefP'></q></dir></style></legend>
              1. <tfoot id='gmefP'></tfoot>
                <i id='gmefP'><tr id='gmefP'><dt id='gmefP'><q id='gmefP'><span id='gmefP'><b id='gmefP'><form id='gmefP'><ins id='gmefP'></ins><ul id='gmefP'></ul><sub id='gmefP'></sub></form><legend id='gmefP'></legend><bdo id='gmefP'><pre id='gmefP'><center id='gmefP'></center></pre></bdo></b><th id='gmefP'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='gmefP'><tfoot id='gmefP'></tfoot><dl id='gmefP'><fieldset id='gmefP'></fieldset></dl></div>

                <small id='gmefP'></small><noframes id='gmefP'>

              2. 本文介紹了將從應用程序獲取的地理位置傳遞給 UIWebView的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我正在開發 iOS 應用程序,我想在其中一個視圖中包含 UIWebView 和包含地圖的頁面(地址是:https://carsharing.mvg-mobil.de).該網站需要位置許可,因此一旦用戶看到此視圖,就會出現一條警報:https://carsharing.mvg-mobil.de/ 想使用您當前的位置.OK/不允許".

                I'm developing the iOS app and in one of the views I would like to include UIWebView with a page that contains a map (the address is: https://carsharing.mvg-mobil.de). The website requires location permission so as soon as the user is presented with this view, an alert appears: "https://carsharing.mvg-mobil.de/ would like to use your current location. OK/Don't allow".

                在我的應用程序中,我從 CoreLocation 框架中獲取了用戶的位置.有沒有辦法將此位置傳遞給此 web 視圖以避免此警報視圖?是否可以通過注入一些 JavaScript 代碼或者以某種方式在 URL 中包含地理位置?

                In my app I have the location of the user fetched from the CoreLocation framework. Is there a way to pass this location to this webview to avoid this alert view? Would it be somehow possible by injecting some JavaScript code or maybe somehow including geolocation in the URL?

                推薦答案

                好的,我在PhoneGap 如何使用從 CoreLocation 獲取的位置將 JavaScript 代碼注入標準 webview:

                OK, I found the solution in the source code of PhoneGap how to inject JavaScript code to a standrad webview with the location fetched from CoreLocation:

                int epoch = [newLocation.timestamp timeIntervalSince1970];
                float course = -1.0f;
                float speed  = -1.0f;
                NSString* coords =  [NSString stringWithFormat:@"coords: { latitude: %f, longitude: %f, altitude: %f, heading: %f, speed: %f, accuracy: %f, altitudeAccuracy: %f }",
                                        newLocation.coordinate.latitude,
                                        newLocation.coordinate.longitude,
                                        newLocation.altitude,
                                        course,
                                        speed,
                                        newLocation.horizontalAccuracy,
                                        newLocation.verticalAccuracy
                                     ];
                
                NSString * jsCallBack = [NSString stringWithFormat:@"navigator.geolocation.setLocation({ timestamp: %d, %@ });", epoch, coords];
                
                [webView stringByEvaluatingJavaScriptFromString:jsCallBack];
                

                希望其他人也可以從這段代碼中獲利.

                Hopefully somebody else can profit from this code as well.

                這篇關于將從應用程序獲取的地理位置傳遞給 UIWebView的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                CLLocation returning negative speed(CLLocation 返回負速度)
                Locations in Core Data sorted by distance via NSFetchedResultsController?(通過 NSFetchedResultsController 按距離排序的核心數據中的位置?)
                Swift: Geofencing / geolocations near user location(Swift:用戶位置附近的地理圍欄/地理位置)
                How to get Location (latitude amp; longitude value) in variable on iOS?(如何在 iOS 上的變量中獲取位置(緯度和經度值)?)
                How to track the device location (iOS and Android) device using Phonegap(如何使用 Phonegap 跟蹤設備位置(iOS 和 Android)設備)
                Easiest way of getting reverse geocoded current location from iOS(從 iOS 獲取反向地理編碼當前位置的最簡單方法)
                  <tbody id='rLnPV'></tbody>
                  • <bdo id='rLnPV'></bdo><ul id='rLnPV'></ul>

                    <tfoot id='rLnPV'></tfoot>

                          <i id='rLnPV'><tr id='rLnPV'><dt id='rLnPV'><q id='rLnPV'><span id='rLnPV'><b id='rLnPV'><form id='rLnPV'><ins id='rLnPV'></ins><ul id='rLnPV'></ul><sub id='rLnPV'></sub></form><legend id='rLnPV'></legend><bdo id='rLnPV'><pre id='rLnPV'><center id='rLnPV'></center></pre></bdo></b><th id='rLnPV'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='rLnPV'><tfoot id='rLnPV'></tfoot><dl id='rLnPV'><fieldset id='rLnPV'></fieldset></dl></div>

                          <small id='rLnPV'></small><noframes id='rLnPV'>

                        • <legend id='rLnPV'><style id='rLnPV'><dir id='rLnPV'><q id='rLnPV'></q></dir></style></legend>
                          主站蜘蛛池模板: 国产高清在线观看 | 国产精品视频一区二区三区 | 中文字幕一区二区视频 | 国产精品国产精品 | 精品一区二区久久久久久久网站 | 婷婷去俺也去 | 亚洲国内精品 | 成人精品免费视频 | 综合激情av| 久久专区 | 日韩中文一区二区三区 | 久久久久久久久99 | 国产日韩欧美精品一区二区三区 | 久久精品亚洲成在人线av网址 | 高清成人免费视频 | 99热精品久久 | 精品在线播放 | 麻豆久久久久 | 成人免费区一区二区三区 | 91网视频 | 91传媒在线观看 | 91av在线免费| 国产精品www | 国产精品69毛片高清亚洲 | 精品国产一区二区三区性色av | 一级全黄视频 | 在线成人 | 91久久婷婷 | 免费影视在线观看 | 影音先锋欧美资源 | 午夜免费成人 | 国产乱码精品一品二品 | 特黄小视频 | www.久久.com| 欧美精品中文 | 青青草视频免费观看 | 三级黄色大片网站 | av一级久久 | 欧美在线a| 日韩一级免费电影 | 国产成人免费视频网站高清观看视频 |