Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions configs/jsactions/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default async args => {
types: ["mendix-client", "react-native"],
allowSyntheticDefaultImports: true,
compilerOptions: {
jsx: "react-native",
newLine: "CRLF"
}
});
Expand Down
4 changes: 4 additions & 0 deletions packages/jsActions/nanoflow-actions-native/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Changed

- Migrated the geolocation actions (`Get current location` and `Get current location with minimum accuracy`) from `@react-native-community/geolocation` to `react-native-nitro-geolocation`.

## [7.1.0] Nanoflow Commons - 2026-6-5

### Changed
Expand Down
3 changes: 2 additions & 1 deletion packages/jsActions/nanoflow-actions-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
},
"dependencies": {
"@react-native-async-storage/async-storage": "2.2.0",
"@react-native-community/geolocation": "3.4.0",
"invariant": "^2.2.4",
"js-base64": "~3.7.2",
"react-native-nitro-geolocation": "1.4.0",
"react-native-nitro-modules": "0.35.9",
"react-native-permissions": "5.5.1",
"react-native-geocoder": "0.5.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Geolocation, {
GeolocationError,
GeolocationOptions,
GeolocationResponse
} from "@react-native-community/geolocation";
} from "react-native-nitro-geolocation/src/compat";

import type { Platform, NativeModules } from "react-native";
import type { GeoError, GeoPosition, GeoOptions } from "../../typings/Geolocation";
Expand Down Expand Up @@ -40,7 +40,7 @@ export async function GetCurrentLocation(
// BEGIN USER CODE

let reactNativeModule: { NativeModules: typeof NativeModules; Platform: typeof Platform } | undefined;
let geolocationModule: typeof import("@react-native-community/geolocation").default | Geolocation;
let geolocationModule: typeof import("react-native-nitro-geolocation/src/compat").default | Geolocation;

if (navigator && navigator.product === "ReactNative") {
reactNativeModule = require("react-native");
Expand All @@ -49,13 +49,7 @@ export async function GetCurrentLocation(
return Promise.reject(new Error("React Native module could not be found"));
}

if (reactNativeModule.NativeModules.RNFusedLocation) {
geolocationModule = (await import("@react-native-community/geolocation")).default;
} else if (reactNativeModule.NativeModules.RNCGeolocation) {
geolocationModule = Geolocation;
} else {
return Promise.reject(new Error("Geolocation module could not be found"));
}
geolocationModule = Geolocation;
} else if (navigator && navigator.geolocation) {
geolocationModule = navigator.geolocation;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Geolocation, {
GeolocationError,
GeolocationOptions,
GeolocationResponse
} from "@react-native-community/geolocation";
} from "react-native-nitro-geolocation/src/compat";

import type { Platform, NativeModules } from "react-native";
import type { GeoError, GeoPosition, GeoOptions } from "../../typings/Geolocation";
Expand Down Expand Up @@ -44,7 +44,7 @@ export async function GetCurrentLocationMinimumAccuracy(
// BEGIN USER CODE

let reactNativeModule: { NativeModules: typeof NativeModules; Platform: typeof Platform } | undefined;
let geolocationModule: typeof import("@react-native-community/geolocation").default | Geolocation;
let geolocationModule: typeof import("react-native-nitro-geolocation/src/compat").default | Geolocation;

if (navigator && navigator.product === "ReactNative") {
reactNativeModule = require("react-native");
Expand All @@ -53,13 +53,7 @@ export async function GetCurrentLocationMinimumAccuracy(
return Promise.reject(new Error("React Native module could not be found"));
}

if (reactNativeModule.NativeModules.RNFusedLocation) {
geolocationModule = (await import("@react-native-community/geolocation")).default;
} else if (reactNativeModule.NativeModules.RNCGeolocation) {
geolocationModule = Geolocation;
} else {
return Promise.reject(new Error("Geolocation module could not be found"));
}
geolocationModule = Geolocation;
} else if (navigator && navigator.geolocation) {
geolocationModule = navigator.geolocation;
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import type {
AuthorizationLevel,
AuthorizationResult,
GeoError,
GeoPosition,
GeoOptions,
GeolocationError,
GeolocationOptions,
GeolocationResponse,
getCurrentPosition,
requestAuthorization,
watchPosition,
clearWatch,
stopObserving
} from "@react-native-community/geolocation";
} from "react-native-nitro-geolocation/src/compat";

type GeoError = GeolocationError;
type GeoPosition = GeolocationResponse;
type GeoOptions = GeolocationOptions;

type GeolocationServiceStatic = {
getCurrentPosition: typeof getCurrentPosition;
Expand All @@ -19,4 +21,4 @@ type GeolocationServiceStatic = {
stopObserving: typeof stopObserving;
};

export type { GeolocationServiceStatic, AuthorizationLevel, AuthorizationResult, GeoError, GeoPosition, GeoOptions };
export type { GeolocationServiceStatic, GeoError, GeoPosition, GeoOptions };
45 changes: 30 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.