Page MenuHomePhabricator

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

Authored by bartek on Jan 14 2023, 8:40 AM.
Tags
None
Referenced Files
F3341748: D6267.diff
Thu, Nov 21, 11:37 PM
Unknown Object (File)
Sat, Nov 9, 2:59 PM
Unknown Object (File)
Fri, Nov 8, 10:06 AM
Unknown Object (File)
Fri, Nov 8, 10:06 AM
Unknown Object (File)
Fri, Nov 8, 10:06 AM
Unknown Object (File)
Thu, Nov 7, 11:36 PM
Unknown Object (File)
Thu, Nov 7, 9:54 PM
Unknown Object (File)
Thu, Nov 7, 9:50 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