How to open Location services screen from setting screen?

前端 未结 11 2088
别那么骄傲
别那么骄傲 2020-12-04 14:01

I want to open location service screen programmatically to turn on service.

11条回答
  •  醉梦人生
    2020-12-04 14:58

    Swift 5+
    Easy Way Direct Your said application page will open

    if let BUNDLE_IDENTIFIER = Bundle.main.bundleIdentifier,
        let url = URL(string: "\(UIApplication.openSettingsURLString)&path=LOCATION/\(BUNDLE_IDENTIFIER)") {
        UIApplication.shared.open(url, options: [:], completionHandler: nil)
    }
    

提交回复
热议问题