From 18ad86b7f4820ff740a728d1212fbdee7d68dc27 Mon Sep 17 00:00:00 2001 From: zhaofengliang Date: Tue, 18 Jun 2024 20:05:06 +0800 Subject: [PATCH] =?UTF-8?q?iOS=20=EF=BD=9Clocation-tencent=20api=20?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=EF=BD=9C=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=AF=91?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../uni-getLocation-tencent/utssdk/app-ios/index.uts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/uni_modules/uni-getLocation-tencent/utssdk/app-ios/index.uts b/uni_modules/uni-getLocation-tencent/utssdk/app-ios/index.uts index c438197..4388d36 100644 --- a/uni_modules/uni-getLocation-tencent/utssdk/app-ios/index.uts +++ b/uni_modules/uni-getLocation-tencent/utssdk/app-ios/index.uts @@ -55,8 +55,8 @@ class LBSLocation implements TencentLBSLocationManagerDelegate { this.locationManager.requestWhenInUseAuthorization() } else if (status == CLAuthorizationStatus.denied || status == CLAuthorizationStatus.restricted) { let ret = new UniError("uni-getLocation-tencent", -30, "permission missed."); - options.fail?.(ret) - options.complete?.(ret) + this.locationOptions?.fail?.(ret) + this.locationOptions?.complete?.(ret) } } } @@ -141,13 +141,13 @@ class LBSLocation implements TencentLBSLocationManagerDelegate { // 实现定位出错的 delegate 方法 tencentLBSDidChangeAuthorization(manager : TencentLBSLocationManager) { - const status = this.getAuthorizationStatus() + const status = CLLocationManager.authorizationStatus() if (status == CLAuthorizationStatus.denied || status == CLAuthorizationStatus.restricted) { let ret = new UniError("uni-getLocation-tencent", -30, "permission missed."); - options.fail?.(ret) - options.complete?.(ret) + this.locationOptions?.fail?.(ret) + this.locationOptions?.complete?.(ret) } else if (status == CLAuthorizationStatus.authorizedAlways || status == CLAuthorizationStatus.authorizedWhenInUse) { - this.getLocation(this.locationOptions) + this.getLocation(this.locationOptions!) } } -- GitLab