2016-09-27 12 views
-1

自分のウェブサイトを表示するためにwebViewをコーディングしているときに問題が発生しています。自分の現在地を数字として取得することを許可できませんでした。webViewで現在の場所を許可する方法はありますか?

私は場所を許可するすべての権限を開設し、そうでない場合は私の場所は、すべてのデバイスのために働いているが、iOSの10

は、私は私が現在位置を取得できるようにするために新たな権限を作るべきか?

import UIKit 
import MapKit 
import CoreLocation 


class ViewController: UIViewController, MKMapViewDelegate, CLLocationManagerDelegate 

{ 

@IBOutlet weak var webview: UIWebView! 





     let locationManager = CLLocationManager() 



     override func viewDidLoad() { 
      super.viewDidLoad() 

      self.locationManager.delegate = self 
      self.locationManager.desiredAccuracy = kCLLocationAccuracyBest 
      self.locationManager.requestWhenInUseAuthorization() 
      self.locationManager.requestAlwaysAuthorization() 
      self.locationManager.startUpdatingLocation() 


      let url = NSURL (string: "http://my-website"); 
      let requestObj = NSURLRequest(url: url! as URL); 
      webview.loadRequest(requestObj as URLRequest); 


     } 

     override func didReceiveMemoryWarning() { 
      super.didReceiveMemoryWarning() 
      // Dispose of any resources that can be recreated. 
     } 




    } 

答えて

0

私はそれを解決するため、問題は(HTTP & HTTPS)にありました。

私のウェブサイトはSafariとChromeで作業していますが、まだiosアプリとして昼食をとることはできません。

誰でも私を助けることができますか?

写真を見てください。正確な不正確なコードを知るためには、下記をご覧ください。

enter image description here

関連する問題