9

How is the app name set in iOS version of the build?

Looking at app/App_Resources/iOS/Info.plist - I see

<key>CFBundleDisplayName</key> <string>${PRODUCT_NAME}</string> <key>CFBundleExecutable</key> <string>${EXECUTABLE_NAME}</string>

How are these 2 set and when are they set (during prepare?)?

dashman
  • 2,858
  • 3
  • 29
  • 51

1 Answers1

10

By default, the name of the app is same as PRODUCT_NAME, which in return is the project name (the root-folder name of your app). EXECUTABLE_NAME is the name of the .ipa file that is generated. I would recommend to leave these two alone, the way they are :)

You can add the following to the Info.plist in order to set your own name:

<key>CFBundleDisplayName</key>
<string>My App</string>

UPDATE: If you need to fetch values from the Info.plist file, you can do it like this:

var utils = require("utils/utils");
var mainBundle = utils.ios.getter(NSBundle, NSBundle.mainBundle);
var appName = mainBundle.infoDictionary.objectForKey("CFBundleDisplayName"));
Manijak
  • 732
  • 7
  • 12
  • So that's the name that will be used to display in the App Store? Is there a way to retrieve these values from within the app at run-time? Thx. – dashman Feb 01 '17 at 20:26
  • 1
    Well both yes and no. AppStore will use that by default to set the name, but in iTunesConnect you can change the AppStore-name to be something else (before you publish). This key mainly used to name the app itself, when you see it in Settings and HomeScreen. – Manijak Feb 01 '17 at 21:43
  • 2
    Updated my post above with code example to fetch values from Info.plist – Manijak Feb 01 '17 at 21:52
  • 1
    "CFBundleDisplayName" key is used for settings and homescreen right? Yes that's what I'd like to set. Thx. – dashman Feb 01 '17 at 23:37
  • what about multilanguage name ? – Royi Namir Jul 27 '18 at 12:40
  • 2
    Note that `utils.ios.getter(...)` is deprecated. You should directly access the native property instead, like this: `const mainBundle = NSBundle.mainBundle;` and then access the display name property as described, using `mainBundle.infoDictionary.objectForKey('CFBundleDisplayName');`. – Lorraine R. Jun 15 '21 at 19:59