Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ff7c40a
getCurrentPosition() using expo-location library
GCyganek Oct 29, 2025
0cecc4a
Merge branch 'main' into @GCyganek/expo-location-migration
GCyganek Nov 3, 2025
af21aba
Simplify makeError and delete misleading comment
GCyganek Nov 3, 2025
ecd6921
Fix gpsPoints not being passed correctly
GCyganek Nov 4, 2025
d340c1b
Remove @react-native-community/geolocation
GCyganek Nov 4, 2025
f727fd1
Merge branch 'main' into @GCyganek/expo-location-migration
GCyganek Nov 4, 2025
8628351
Update Podfile
GCyganek Nov 4, 2025
16c35df
Run CI
GCyganek Nov 4, 2025
2eace40
Run CI
GCyganek Nov 5, 2025
43b65f7
Merge branch 'main' into @GCyganek/expo-location-migration
GCyganek Nov 5, 2025
3158a0a
Fix Podfile.lock cocoapods version
GCyganek Nov 5, 2025
cdae7fa
Run CI
GCyganek Nov 5, 2025
1aed380
Rerun jest tests
GCyganek Nov 5, 2025
86a8cf4
Podfile.lock cleanup
GCyganek Nov 5, 2025
1159a1b
Mobile-Expensify
GCyganek Nov 5, 2025
70677d4
Revert Mobile-Expensify changes
GCyganek Nov 5, 2025
500718a
Rerun CI
GCyganek Nov 5, 2025
07bc072
Merge branch 'main' into @GCyganek/expo-location-migration
GCyganek Nov 5, 2025
3520491
runOnJS => scheduleOnRN
GCyganek Nov 5, 2025
75bd6c0
Merge branch 'main' into @GCyganek/expo-location-migration
GCyganek Nov 6, 2025
36cbc10
Merge branch 'main' into @GCyganek/expo-location-migration
GCyganek Nov 7, 2025
bc24fe6
Rerun Jest tests
GCyganek Nov 7, 2025
87a3edb
Rerun Jest tests
GCyganek Nov 7, 2025
d6784f2
Merge branch 'main' into @GCyganek/expo-location-migration
GCyganek Nov 12, 2025
b7ab0ef
Merge branch 'main' into @GCyganek/expo-location-migration
GCyganek Nov 14, 2025
f14856c
Merge branch 'main' into @GCyganek/expo-location-migration
GCyganek Nov 21, 2025
f142f3c
Merge branch 'main' into @GCyganek/expo-location-migration
GCyganek Nov 24, 2025
15d72a4
Fix error by checking if error is instance of GeolocationPositionError
GCyganek Nov 25, 2025
44642f6
Better error message when location permission not granted
GCyganek Nov 25, 2025
1e474e2
Merge branch 'main' into @GCyganek/expo-location-migration
GCyganek Nov 25, 2025
521e682
Fix eslint error
GCyganek Nov 25, 2025
8c0db69
Merge branch 'main' into @GCyganek/expo-location-migration
GCyganek Nov 28, 2025
48713a8
Delete desktop code as it's deprecated
GCyganek Nov 28, 2025
c13b228
Rerun Jest tests
GCyganek Nov 28, 2025
5121a24
Merge branch 'main' into @GCyganek/expo-location-migration
GCyganek Dec 10, 2025
7b4ed22
Delete desktop related code
GCyganek Dec 10, 2025
4ecf67e
Merge branch 'main' into @GCyganek/expo-location-migration
GCyganek Dec 10, 2025
9efc2a4
Fix SearchContextTest typecheck error
GCyganek Dec 10, 2025
6f20fe9
Merge branch 'main' into @GCyganek/expo-location-migration
GCyganek Dec 10, 2025
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
11 changes: 9 additions & 2 deletions desktop/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,28 @@ import log from 'electron-log';
import {autoUpdater} from 'electron-updater';
import type {AuthType, PermissionType} from 'node-mac-permissions';
import {machineId} from 'node-machine-id';
import type {ValueOf} from 'type-fest';
import checkForUpdates from '@libs/checkForUpdates';
import {translate} from '@libs/Localize';
import Log from '@libs/Log';
import CONFIG from '@src/CONFIG';
import CONST from '@src/CONST';
import IntlStore from '@src/languages/IntlStore';
import type {TranslationPaths} from '@src/languages/types';
import type {LocationPermissionState} from '@src/libs/getCurrentPosition/locationPermission';
import {LOCATION_PERMISSION_STATES} from '@src/libs/getCurrentPosition/locationPermission';
import type PlatformSpecificUpdater from '@src/setup/platformSetup/types';
import type {Locale} from '@src/types/onyx';
import type {CreateDownloadQueueModule, DownloadItem} from './createDownloadQueue';
import serve from './electron-serve';
import ELECTRON_EVENTS from './ELECTRON_EVENTS';

const LOCATION_PERMISSION_STATES = {
GRANTED: 'granted',
DENIED: 'denied',
PROMPT: 'prompt',
} as const;

type LocationPermissionState = ValueOf<typeof LOCATION_PERMISSION_STATES>;

const createDownloadQueue = require<CreateDownloadQueueModule>('./createDownloadQueue').default;

const port = process.env.PORT ?? 8082;
Expand Down
38 changes: 6 additions & 32 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ PODS:
- EXImageLoader
- ExpoModulesCore
- SDWebImageWebPCoder
- ExpoLocation (19.0.7):
- ExpoModulesCore
- ExpoModulesCore (3.0.18):
- boost
- DoubleConversion
Expand Down Expand Up @@ -2421,34 +2423,6 @@ PODS:
- ReactCommon/turbomodule/core
- SocketRocket
- Yoga
- react-native-geolocation (3.3.0):
- boost
- DoubleConversion
- fast_float
- fmt
- glog
- hermes-engine
- RCT-Folly
- RCT-Folly/Fabric
- RCTRequired
- RCTTypeSafety
- React-Core
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-ImageManager
- React-jsi
- React-NativeModulesApple
- React-RCTFabric
- React-renderercss
- React-rendererdebug
- React-utils
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- SocketRocket
- Yoga
- react-native-get-random-values (1.11.0):
- React-Core
- react-native-image-picker (7.1.2):
Expand Down Expand Up @@ -4172,6 +4146,7 @@ DEPENDENCIES:
- ExpoFont (from `../node_modules/expo-font/ios`)
- ExpoImage (from `../node_modules/expo-image/ios`)
- ExpoImageManipulator (from `../node_modules/expo-image-manipulator/ios`)
- ExpoLocation (from `../node_modules/expo-location/ios`)
- ExpoModulesCore (from `../node_modules/expo-modules-core`)
- ExpoSecureStore (from `../node_modules/expo-secure-store/ios`)
- ExpoStoreReview (from `../node_modules/expo-store-review/ios`)
Expand Down Expand Up @@ -4229,7 +4204,6 @@ DEPENDENCIES:
- "react-native-cameraroll (from `../node_modules/@react-native-camera-roll/camera-roll`)"
- react-native-config (from `../node_modules/react-native-config`)
- "react-native-document-picker (from `../node_modules/@react-native-documents/picker`)"
- "react-native-geolocation (from `../node_modules/@react-native-community/geolocation`)"
- react-native-get-random-values (from `../node_modules/react-native-get-random-values`)
- react-native-image-picker (from `../node_modules/react-native-image-picker`)
- react-native-key-command (from `../node_modules/react-native-key-command`)
Expand Down Expand Up @@ -4383,6 +4357,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/expo-image/ios"
ExpoImageManipulator:
:path: "../node_modules/expo-image-manipulator/ios"
ExpoLocation:
:path: "../node_modules/expo-location/ios"
ExpoModulesCore:
:path: "../node_modules/expo-modules-core"
ExpoSecureStore:
Expand Down Expand Up @@ -4494,8 +4470,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-config"
react-native-document-picker:
:path: "../node_modules/@react-native-documents/picker"
react-native-geolocation:
:path: "../node_modules/@react-native-community/geolocation"
react-native-get-random-values:
:path: "../node_modules/react-native-get-random-values"
react-native-image-picker:
Expand Down Expand Up @@ -4663,6 +4637,7 @@ SPEC CHECKSUMS:
ExpoFont: 86ceec09ffed1c99cfee36ceb79ba149074901b5
ExpoImage: e88f500585913969b930e13a4be47277eb7c6de8
ExpoImageManipulator: 7cb78b082bcc767b97867d833ce614ace424cd97
ExpoLocation: 1dc9e4c06ef66ed081348a11eb637d1dfecc7d61
ExpoModulesCore: e1b5401a7af4c7dbf4fe26b535918a72c6ed8a7b
ExpoSecureStore: 3f1b632d6d40bcc62b4983ef9199cd079592a50a
ExpoStoreReview: 15f19e0d6cb6e00330ba1b356485bf47ef19c39a
Expand Down Expand Up @@ -4755,7 +4730,6 @@ SPEC CHECKSUMS:
react-native-cameraroll: 8e83b1a4f8abb386b37599918a412add4a87c5e7
react-native-config: 62c1dce61201623334f751c71c7b12c4accbdff8
react-native-document-picker: 18a9d68e6117d37ac5facd87619cbc3ff17575a7
react-native-geolocation: e7b502b85361b43c94d4270c7f6ff67af44f9aae
react-native-get-random-values: d16467cf726c618e9c7a8c3c39c31faa2244bbba
react-native-image-picker: 1722f5d3dc5de5039d423e290dc31a717ba9605e
react-native-key-command: 7538df85ed26502b2a929c0584235459b26c7a91
Expand Down
36 changes: 10 additions & 26 deletions package-lock.json

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

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@
"@pusher/pusher-websocket-react-native": "^1.3.1",
"@react-native-camera-roll/camera-roll": "7.4.0",
"@react-native-clipboard/clipboard": "^1.15.0",
"@react-native-community/geolocation": "3.3.0",
"@react-native-community/netinfo": "11.2.1",
"@react-native-documents/picker": "^10.1.3",
"@react-native-firebase/analytics": "^22.2.1",
Expand Down Expand Up @@ -142,6 +141,7 @@
"expo-font": "14.0.8",
"expo-image": "3.0.8",
"expo-image-manipulator": "^13.1.5",
"expo-location": "^19.0.7",
"expo-modules-core": "3.0.18",
"expo-secure-store": "~14.2.4",
"expo-store-review": "~9.0.8",
Expand Down Expand Up @@ -170,7 +170,6 @@
"react-map-gl": "^7.1.3",
"react-native": "0.81.4",
"react-native-advanced-input-mask": "1.4.6",
"react-native-android-location-enabler": "^3.0.1",
"react-native-app-logs": "0.3.1",
"react-native-blob-util": "0.22.2",
"react-native-collapsible": "^1.6.2",
Expand Down
4 changes: 0 additions & 4 deletions src/components/AddressSearch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,6 @@ function AddressSearch({
setIsFetchingCurrentLocation(false);
setLocationErrorCode(errorData?.code ?? null);
},
{
maximumAge: 0, // No cache, always get fresh location info
timeout: 30000,
},
);
};

Expand Down
34 changes: 4 additions & 30 deletions src/libs/getCurrentPosition/getCurrentPosition.types.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import type {LocationOptions} from 'expo-location';
import type {ValueOf} from 'type-fest';

type GeolocationSuccessCallback = (position: {
coords: {
latitude: number;
longitude: number;
altitude: number | null;
accuracy: number;
accuracy: number | null;
altitudeAccuracy: number | null;
heading: number | null;
speed: number | null;
Expand All @@ -15,16 +16,7 @@ type GeolocationSuccessCallback = (position: {

type GeolocationErrorCodeType = ValueOf<typeof GeolocationErrorCode> | null;

type GeolocationErrorCallback = (error?: {
code: GeolocationErrorCodeType;
message: string;
PERMISSION_DENIED: typeof GeolocationErrorCode.PERMISSION_DENIED;
POSITION_UNAVAILABLE: typeof GeolocationErrorCode.POSITION_UNAVAILABLE;
TIMEOUT: typeof GeolocationErrorCode.TIMEOUT;

/* Web only */
NOT_SUPPORTED?: typeof GeolocationErrorCode.NOT_SUPPORTED;
}) => void;
type GeolocationErrorCallback = (error?: {code: GeolocationErrorCodeType; message: string}) => void;

const GeolocationErrorCode = {
PERMISSION_DENIED: 1,
Expand All @@ -33,25 +25,7 @@ const GeolocationErrorCode = {
NOT_SUPPORTED: -1,
};

type GeolocationOptions = {
timeout?: number;
maximumAge?: number;
enableHighAccuracy?: boolean;

/** Native only */
distanceFilter?: number;

/** Native only */
useSignificantChanges?: boolean;

/** Native only */
interval?: number;

/** Native only */
fastestInterval?: number;
};

type GetCurrentPosition = (success: GeolocationSuccessCallback, error: GeolocationErrorCallback, options?: GeolocationOptions) => void;
type GetCurrentPosition = (success: GeolocationSuccessCallback, error: GeolocationErrorCallback, options?: LocationOptions) => Promise<void>;

export {GeolocationErrorCode};

Expand Down
55 changes: 0 additions & 55 deletions src/libs/getCurrentPosition/index.android.ts

This file was deleted.

Loading
Loading