Set app name in environment

Hi all,

i have a stage and a prod environment in my project, is it possible to set there the app name and also the app id?

i was looking throug the docs but couldnt find anything :frowning:

also a manipulation of the app icon would be interesting :slight_smile:

best regards
harald

edit: i tried to put it in the command line while buildingā€¦ ionic cordova build android --release --variable APP_NAME=ā€œSTAGEā€
but it seems this is not used

Did you find this?

uh thanks, but thats confusing for meā€¦ setting a variable in the angular framework is able to overwrite the bundle name for the ionic android app name?

I thought by ā€œapp nameā€ you just meant having some environment-dependent variable available for display to the user inside the app.

oh no sorry for missundertandingā€¦ i mean the app name that is visible under the app icon

it would also be okay when i could provide the app name from the command line :slight_smile:

so that the users can see if this is the STAGING app or the PRODUCTIVE App

In that case Iā€™m not aware of any official hook for doing that, but I would suggest looking into customizing the scripts stanza of package.json to call some sort of script to do what you are looking for at the beginning of npm run build - thatā€™s what Iā€™ve done to bake things like git commit hashes into app code.

yes that was something i would try to doā€¦ but to do so i would need a possibility to provide the app name over the command lineā€¦ i found some older posts for older versions of ionic where they did it by adding --variable APP_NAME=ā€œDemo APPā€ to the build commandā€¦ but i think this is not working any more.

is there maybe a newer command to do that?

rapropos, it helped, thanks.