Last active
April 30, 2023 11:19
-
-
Save ErykDarnowski/f65600c0767cca84fd9921dcbae1d00f to your computer and use it in GitHub Desktop.
How to get app's package name in Expo app (in React Native). This is a quick and dirty hack for getting the app's package name when testing stuff out and switching between the managed and bare (ejected) workflow. In my case this was heplful when linking the user to the app's notification settings page,
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { expo as appJson } from '../app.json'; | |
// @ts-ignore | |
const packageName: string = appJson.android.package ?? 'host.exp.exponent'; | |
// ^ Gets the apps package name, however if the `Expo Go` app is used it defaults to it's package name. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment