skip to Main Content

I have two separated Firebase projects, one for dev and other for prod environment.
I’m trying to add my Expo app to the dev project but I cannot add the same app package in two different projects.

How to handle app package name in both projects? Should I use env variables inside expo to change the package name?

Also, when I upload my app to stores for internal tests and publishing, will I have to build the app two times? one for dev and one for final prod version?

Thanks for the help

2

Answers


  1. Chosen as BEST ANSWER

    If someone else ends up with same question:

    Here's expo documentation link

    in your package.json create a script setting the APP_VARIANT env variable:

    "android|ios": "APP_VARIANT=development expo prebuild --clean && expo run:android|ios --device"
    

    It's important to perform a clean prebuild as this rename and recreates all files based on current app packaged name as this changes based on current environment.

    Now inside your app.config.js you just need to follow above docs link to get your app switching package name


  2. {
    "expo": {
    "name": "Notes Guru",
    "slug": "notes-guru",
    "version": "2.0.0",
    "orientation": "portrait",
    "icon": "./assets/logo.jpg",
    "userInterfaceStyle": "light",
    "notification": {
    "icon": "./assets/logo_mini.png"
    },
    "splash": {
    "image": "./assets/template.png",
    "resizeMode": "contain",
    "backgroundColor": "#ffffff"
    },
    "updates": {
    "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
    "**/*"
    ],
    "ios": {
    "icon": "./assets/logo.jpg",
    "supportsTablet": true,
    "infoPlist": {
    "NSRemindersUsageDescription": "This app uses the calendar"
    },
    "associatedDomains": [
    "applinks:test.page.link"
    ],
    "bundleIdentifier": "com.jk0712.7Search-ppc-advertiser"
    },
    "android": {
    "package": "notesguru.org",
    "versionCode": 2,
    "googleServicesFile": "./google-services.json",
    "adaptiveIcon": {
    "foregroundImage": "./assets/logo.png",
    "backgroundColor": "#FFFFFF"
    }
    },
    "web": {
    "favicon": "./assets/logo.png"
    },
    "extra": {
    "eas": {
    "projectId": "d7e815f1-ef5f-4834-bd4b-69ad85f633e5"
    }
    }
    }
    }

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search