Skip to content

Commit 040732c

Browse files
committed
release(geolocation): 8.0.4
1 parent 7d9db44 commit 040732c

File tree

2 files changed

+41
-42
lines changed

2 files changed

+41
-42
lines changed

packages/geolocation/index.ios.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ class LocationListenerImpl extends NSObject implements CLLocationManagerDelegate
7878
}
7979

8080
private _handleAuthorizationChange(status: CLAuthorizationStatus) {
81-
8281
// the permisssion listener doesn't resolve
8382
if (this._onPermissionChange) {
8483
this._onPermissionChange(status);
@@ -181,13 +180,14 @@ export function getCurrentLocation(options?: Options): Promise<Location> {
181180
reject(new Error('There is no last known location!'));
182181
}
183182
} else {
184-
let timerId: number;
183+
let timerId: any;
185184
let locListener: any;
186185
let initLocation: Location;
187186

188187
const stopTimerAndMonitor = function (locListenerId) {
189-
if (timerId !== undefined) {
188+
if (typeof timerId === 'number') {
190189
clearTimeout(timerId);
190+
timerId = null;
191191
}
192192

193193
LocationMonitor.stopLocationMonitoring(locListenerId);
@@ -287,8 +287,7 @@ export function enableLocationRequest(always?: boolean, openSettingsIfLocationHa
287287
return;
288288
} else {
289289
const status = getIOSLocationManagerStatus();
290-
if ((status === CLAuthorizationStatus.kCLAuthorizationStatusDenied && openSettingsIfLocationHasBeenDenied) ||
291-
(!_systemDialogWillShow(always, status) && openSettingsIfLocationHasBeenDenied)) {
290+
if ((status === CLAuthorizationStatus.kCLAuthorizationStatusDenied && openSettingsIfLocationHasBeenDenied) || (!_systemDialogWillShow(always, status) && openSettingsIfLocationHasBeenDenied)) {
292291
// now open the Settings so the user can toggle the Location permission
293292
UIApplication.sharedApplication.openURL(NSURL.URLWithString(UIApplicationOpenSettingsURLString));
294293
reject();
@@ -312,7 +311,7 @@ export function enableLocationRequest(always?: boolean, openSettingsIfLocationHa
312311

313312
function _systemDialogWillShow(always: boolean, status: CLAuthorizationStatus): boolean {
314313
// the system dialog for "always" permission will not show if we requested it previously and currently have "when use" permission
315-
return !(status === CLAuthorizationStatus.kCLAuthorizationStatusAuthorizedWhenInUse && always && ApplicationSettings.getBoolean('hasRequestedAlwaysAuthorization', false))
314+
return !(status === CLAuthorizationStatus.kCLAuthorizationStatusAuthorizedWhenInUse && always && ApplicationSettings.getBoolean('hasRequestedAlwaysAuthorization', false));
316315
}
317316

318317
function _isEnabled(always?: boolean): boolean {

packages/geolocation/package.json

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
{
2-
"name": "@nativescript/geolocation",
3-
"version": "8.0.2",
4-
"description": "Provides API for getting and monitoring location for NativeScript app.",
5-
"main": "index",
6-
"typings": "index.d.ts",
7-
"nativescript": {
8-
"platforms": {
9-
"ios": "6.0.0",
10-
"android": "6.0.0"
11-
}
12-
},
13-
"repository": {
14-
"type": "git",
15-
"url": "https://github.com/NativeScript/plugins.git"
16-
},
17-
"keywords": [
18-
"NativeScript",
19-
"JavaScript",
20-
"TypeScript",
21-
"iOS",
22-
"Android"
23-
],
24-
"author": {
25-
"name": "NativeScript",
26-
"email": "oss@nativescript.org"
27-
},
28-
"bugs": {
29-
"url": "https://github.com/NativeScript/plugins/issues"
30-
},
31-
"license": "Apache-2.0",
32-
"homepage": "https://github.com/NativeScript/plugins",
33-
"readmeFilename": "README.md",
34-
"bootstrapper": "@nativescript/plugin-seed",
35-
"dependencies": {
36-
"nativescript-permissions": "1.3.11"
37-
}
2+
"name": "@nativescript/geolocation",
3+
"version": "8.0.4",
4+
"description": "Provides API for getting and monitoring location for NativeScript app.",
5+
"main": "index",
6+
"typings": "index.d.ts",
7+
"nativescript": {
8+
"platforms": {
9+
"ios": "6.0.0",
10+
"android": "6.0.0"
11+
}
12+
},
13+
"repository": {
14+
"type": "git",
15+
"url": "https://github.com/NativeScript/plugins.git"
16+
},
17+
"keywords": [
18+
"NativeScript",
19+
"JavaScript",
20+
"TypeScript",
21+
"iOS",
22+
"Android"
23+
],
24+
"author": {
25+
"name": "NativeScript",
26+
"email": "oss@nativescript.org"
27+
},
28+
"bugs": {
29+
"url": "https://github.com/NativeScript/plugins/issues"
30+
},
31+
"license": "Apache-2.0",
32+
"homepage": "https://github.com/NativeScript/plugins",
33+
"readmeFilename": "README.md",
34+
"bootstrapper": "@nativescript/plugin-seed",
35+
"dependencies": {
36+
"nativescript-permissions": "1.3.11"
37+
}
3838
}

0 commit comments

Comments
 (0)