提交 5539c89d 编写于 作者: lizhongyi_'s avatar lizhongyi_

fix: 处理获取定位权限代理方法不回掉问题

上级 113227c5
...@@ -69,7 +69,7 @@ class LocationPromiseService implements CLLocationManagerDelegate { ...@@ -69,7 +69,7 @@ class LocationPromiseService implements CLLocationManagerDelegate {
return true return true
} }
locationManager(manager: CLLocationManager, status: CLAuthorizationStatus) { locationManager(manager: CLLocationManager, @argumentLabel("didChangeAuthorization") status: CLAuthorizationStatus) {
if (status == CLAuthorizationStatus.authorizedAlways || status == CLAuthorizationStatus.authorizedWhenInUse) { if (status == CLAuthorizationStatus.authorizedAlways || status == CLAuthorizationStatus.authorizedWhenInUse) {
LocationPromiseService.promiseCompletionHandler.forEach((handler): void => { LocationPromiseService.promiseCompletionHandler.forEach((handler): void => {
handler(true) handler(true)
...@@ -82,23 +82,6 @@ class LocationPromiseService implements CLLocationManagerDelegate { ...@@ -82,23 +82,6 @@ class LocationPromiseService implements CLLocationManagerDelegate {
}) })
} }
} }
locationManagerDidChangeAuthorization(manager: CLLocationManager) {
}
locationManagerDidPauseLocationUpdates(manager: CLLocationManager) {
}
locationManagerDidResumeLocationUpdates(manager: CLLocationManager) {
}
locationManagerShouldDisplayHeadingCalibration(manager: CLLocationManager): boolean {
return true
}
requestPromise(@escaping completion: (res: boolean)=>void) { requestPromise(@escaping completion: (res: boolean)=>void) {
let status: CLAuthorizationStatus = CLLocationManager.authorizationStatus() let status: CLAuthorizationStatus = CLLocationManager.authorizationStatus()
if (status == CLAuthorizationStatus.notDetermined) { if (status == CLAuthorizationStatus.notDetermined) {
...@@ -132,6 +115,12 @@ function requestLocationPromise(@escaping completion: (res: boolean)=>void) { ...@@ -132,6 +115,12 @@ function requestLocationPromise(@escaping completion: (res: boolean)=>void) {
function fetchConnectedWifiWithLocationPromise(option: GetConnectedWifiOptions) { function fetchConnectedWifiWithLocationPromise(option: GetConnectedWifiOptions) {
let arr = CNCopySupportedInterfaces() let arr = CNCopySupportedInterfaces()
let wifiInfo = new UniWifiInfo() let wifiInfo = new UniWifiInfo()
wifiInfo.BSSID = ""
wifiInfo.SSID = ""
wifiInfo.secure = false
wifiInfo.signalStrength = 0
wifiInfo.frequency = 0
if (arr != null) { if (arr != null) {
let list = arr! as NSArray let list = arr! as NSArray
let index = 0 let index = 0
...@@ -251,7 +240,7 @@ export function getConnectedWifi(option: GetConnectedWifiOptions) { ...@@ -251,7 +240,7 @@ export function getConnectedWifi(option: GetConnectedWifiOptions) {
if (UniWiFiModuleGloabInfo.alreadyStartWifi == false) { if (UniWiFiModuleGloabInfo.alreadyStartWifi == false) {
let res = { let res = {
errCode: 12000, errCode: 12000,
errMsg: "not invoke startWifi", errMsg: "getConnectedWifi: not init",
wifi: wifiInfo wifi: wifiInfo
} }
option.fail?.(res) option.fail?.(res)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册