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> {
176176 _isLocationServiceEnabled ( ) . then ( ( ) => {
177177 resolve ( ) ;
178178 } , ( 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+
181182 try {
183+ // cache resolve and reject callbacks in order to call them
184+ // on REQUEST_ENABLE_LOCATION Activity Result
182185 _onEnableLocationSuccess = resolve ;
183186 _onEnableLocationFail = reject ;
184187 ex . startResolutionForResult ( androidAppInstance . foregroundActivity , REQUEST_ENABLE_LOCATION ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " nativescript-geolocation" ,
3- "version" : " 4.2.2 " ,
3+ "version" : " 4.2.3 " ,
44 "description" : " Provides API for getting and monitoring location for NativeScript app." ,
55 "main" : " geolocation" ,
66 "nativescript" : {
You can’t perform that action at this time.
0 commit comments