Page MenuHomePhabricator

[native] Add 'natDevHostname' field to Expo config
ClosedPublic

Authored by bartek on Jan 14 2023, 8:40 AM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 22 2024, 5:30 AM
Unknown Object (File)
Nov 22 2024, 5:07 AM
Unknown Object (File)
Nov 21 2024, 11:37 PM
Unknown Object (File)
Nov 9 2024, 2:59 PM
Unknown Object (File)
Nov 8 2024, 10:06 AM
Unknown Object (File)
Nov 8 2024, 10:06 AM
Unknown Object (File)
Nov 8 2024, 10:06 AM
Unknown Object (File)
Nov 7 2024, 11:36 PM
Subscribers

Details

Summary
  • Created the app.config.js, which is a dynamic version of app.json - you can read more about them in the official guide. The file is evaluated when running yarn dev in native.
  • Added the natDevHostname field to the "extra" config
  • The field is supplied with local machine IP address

Depends on D6266

Test Plan

Open native yarn dev and run app (either physical device or simulator).
The following should work:

// in native app (e.g. in `root.react.js`)
import Constants from 'expo-constants';
console.log(Constants.expoConfig.extra.natDevHostname);

Ensured it displays local LAN IP of my MacBook.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable