This repository was archived by the owner on Nov 8, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -176,9 +176,12 @@ export function enableLocationRequest(always?: boolean): Promise<void> {
176
176
_isLocationServiceEnabled ( ) . then ( ( ) => {
177
177
resolve ( ) ;
178
178
} , ( ex ) => {
179
- let statusCode = ex . getStatusCode ( ) ;
180
- if ( statusCode === com . google . android . gms . common . api . CommonStatusCodes . RESOLUTION_REQUIRED ) {
179
+ if ( typeof ex . getStatusCode === "function" &&
180
+ ex . getStatusCode ( ) === com . google . android . gms . common . api . CommonStatusCodes . RESOLUTION_REQUIRED ) {
181
+
181
182
try {
183
+ // cache resolve and reject callbacks in order to call them
184
+ // on REQUEST_ENABLE_LOCATION Activity Result
182
185
_onEnableLocationSuccess = resolve ;
183
186
_onEnableLocationFail = reject ;
184
187
ex . startResolutionForResult ( androidAppInstance . foregroundActivity , REQUEST_ENABLE_LOCATION ) ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " nativescript-geolocation" ,
3
- "version" : " 4.2.2 " ,
3
+ "version" : " 4.2.3 " ,
4
4
"description" : " Provides API for getting and monitoring location for NativeScript app." ,
5
5
"main" : " geolocation" ,
6
6
"nativescript" : {
You can’t perform that action at this time.
0 commit comments