Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where CFBundleName is being used

From this old question: What's the difference between "bundle display name" and "bundle name" in cocoa application's info plist

It points to the official docs, which say:

CFBundleName

CFBundleName (String - iOS, OS X) identifies the short name of the bundle. This name should be less than 16 characters long and be suitable for displaying in the menu bar and the app’s Info window. You can include this key in the InfoPlist.strings file of an appropriate .lproj subdirectory to provide localized values for it. If you localize this key, you should also include the key “CFBundleDisplayName.”

Can anyone tell how to show this name in iOS?

I was never able to show this value in my iPhone.

like image 695
Ryan Avatar asked Aug 27 '12 17:08

Ryan


People also ask

What is CFBundleName?

A user-visible short name for the bundle. iOS 2.0+ iPadOS 2.0+ macOS 10.0+ tvOS 9.0+ watchOS 2.0+

Can I change CFBundleName?

Go to the Xcode project folder and open Info. plist for edit (in Xcode you can choose Open As > Source Code in file context menu). All we need is edit value for key CFBundleName. It's a user-visible short name for the bundle.

What is bundle display name?

The user-visible name for the bundle, used by Siri and visible on the iOS Home screen.

What is bundle display name Xcode?

CFBundleName (String - iOS, Mac OS X) identifies the short name of the bundle. This name should be less than 16 characters long and be suitable for displaying in the menu bar and the application's Info window. You can include this key in the InfoPlist. strings file of an appropriate .


2 Answers

It doesn't look to me like CFBundleName shows anywhere to the user, on iOS. I believe I've seen documentation for Mac OS X (which obviously iOS inherits a lot of legacy infrastructure from), that says that the Bundle Name is used for something else ... I think it might have been the name in the upper Menu bar, or the lower Dock bar. Neither thing exists in iOS, of course.

I also found this Stack Overflow answer, which is now quite old (but with quite a few upvotes). This answer claims that CFBundleName would be the name of the folder that the app is stored in. So, for example, CFBundleName = HelloWorld should produce

+- HelloWorld.app
    - HelloWorldApplication

If the Executable Name was set to be HelloWorldApplication. However, I just built a simple program and ran it on iOS 5.0, and the .app folder was not named equal to CFBundleName. So, if it ever worked that way, it doesn't seem to any more.

I have seen quite a few references that say that CFBundleName should be left set to ${PRODUCT_NAME} in Xcode, which is what I always do. Not as a technical limitation, but as an Apple review criterion, I've also seen people claim that CFBundleDisplayName must be closely related to CFBundleName. For example, it's ok if it's a shortened version of CFBundleName, but that they might reject the app if it's unrelated altogether.

I also checked the listing in Settings.app, and in iTunes, and I didn't see the Bundle Name either of those places.

So, to answer your question, I don't believe this variable is visible to the user (on iOS).


Update: I have not, however, checked whether or not any accessibility features might speak this name anywhere.

Also, this SO answer claims that CFBundleName will be the name used in the iTunes App Store URL for your app. But, see @tc.'s comment/example URL below ...


Update 2: per @honus's comment below, one unusual scenario where CFBundleName can be shown to the user is if your app has no entry for CFBundleDisplayName in its Info.plist file. In that case, CFBundleName will be shown under the app icon in SpringBoard.

like image 182
Nate Avatar answered Sep 29 '22 06:09

Nate


It's not well-documented, but CFBundleName is displayed to the user in the permission dialog displayed by ASWebAuthenticationSession.

ASWebAuthenticationSession Dialog Example

like image 44
robmathers Avatar answered Sep 29 '22 06:09

robmathers