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
If someone else ends up with same question:
Here's expo documentation link
in your
package.json
create a script setting theAPP_VARIANT
env variable: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{
"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"
}
}
}
}