久久久久久久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的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我正在開發(fā) iOS 應用程序,我想在其中一個視圖中包含 UIWebView 和包含地圖的頁面(地址是:https://carsharing.mvg-mobil.de).該網站需要位置許可,因此一旦用戶看到此視圖,就會出現(xiàn)一條警報: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模板網!

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

                相關文檔推薦

                CLLocation returning negative speed(CLLocation 返回負速度)
                Locations in Core Data sorted by distance via NSFetchedResultsController?(通過 NSFetchedResultsController 按距離排序的核心數(shù)據(jù)中的位置?)
                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>
                          主站蜘蛛池模板: 亚洲一区网站 | 国产主播第一页 | 精品电影| 成人国产午夜在线观看 | 国产香蕉视频在线播放 | 亚洲va在线va天堂va狼色在线 | 黄色大片免费网站 | 日本一区精品 | www久久99 | 精品在线免费看 | 国产精品无码专区在线观看 | 久久精品久久久久久 | h片免费在线观看 | 日韩精品成人 | 日韩一区和二区 | 在线观看成人免费视频 | 精品久久电影 | 久草视频在线播放 | 免费在线看黄视频 | 成人一区二区三区在线观看 | 久久久久亚洲精品 | 日韩av一二三区 | 中文字幕欧美日韩 | 一区二区三区视频在线观看 | 精品免费视频一区二区 | 81精品国产乱码久久久久久 | 日韩电影一区 | 精品久久久久久久 | 三级视频国产 | 91成人在线| 亚洲国产精品一区二区三区 | 精品国产乱码久久久久久88av | 狠狠干天天干 | 国产成人免费 | 国产视频精品免费 | 久久久久久久久91 | 国产人成精品一区二区三 | 欧美性久久久 | 午夜播放器在线观看 | 人人爽人人爽 | 在线观看精品 |