Skip to content

Commit 436af01

Browse files
Merge branch 'main' into moo/moo-1800/dependency-update
2 parents c3bc35c + 39e9d73 commit 436af01

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

packages/jsActions/nanoflow-actions-native/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
### Fixed
10+
11+
- We've fixed location permission issue on iOS.
12+
913
### Changed
1014

1115
- We've updated the minimum Mendix version to 10.21.

packages/jsActions/nanoflow-actions-native/src/geolocation/RequestLocationPermission.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// - the code between BEGIN USER CODE and END USER CODE
66
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
77
// Other code you write will be lost the next time you deploy the project.
8-
import Geolocation, { GeolocationError } from "@react-native-community/geolocation";
8+
import Geolocation from "@react-native-community/geolocation";
99

1010
import type { GeolocationServiceStatic, AuthorizationResult } from "../../typings/Geolocation";
1111

@@ -119,14 +119,16 @@ export async function RequestLocationPermission(): Promise<boolean> {
119119
)
120120
);
121121
} else if (geolocationModule) {
122-
geolocationModule.requestAuthorization(
123-
() => {
124-
return Promise.resolve(true);
125-
},
126-
(err: GeolocationError) => {
127-
return Promise.reject(err);
128-
}
129-
);
122+
return new Promise(resolve => {
123+
geolocationModule.requestAuthorization(
124+
() => {
125+
resolve(true);
126+
},
127+
() => {
128+
resolve(false);
129+
}
130+
);
131+
});
130132
}
131133

132134
return false;

0 commit comments

Comments
 (0)