Search code examples
xcodemacosbundle-identifier

OS X Bundle Identifier name: Best practice in this situation


I have an App that I am about to release to the App store. The App has the same name as the company. I know the recommended way to name your bundle identifier is

com.yourcompanyname.appname

However, it would seem silly and repetitive to name it like this for example

com.applemaps.applemaps

Can't I just name it like "com.applemaps" to avoid repetitiveness?

Lastly, should I have .mac at the end to differentiate between iPhone and Mac app?

Edit: I do see GitHub named their bundle identifier like so and evernote did something similar.

com.github.GitHub


Solution

  • The only purpose of the bundle identifier is to identify this app uniquely. There is no hard and fast rule that you have to use reverse URL notation; it's just a recommended convention. And you can put anything you like.

    Having said that, I would recommend against either of your first two proposals, just because you don't want to risk lack of uniqueness. In particular, com.applemaps seems like a really bad idea. Suppose another company named applemaps came along? It seems to me that the longer the better, because each element you add is an element that this other company probably won't add. So, com.applemaps.applemaps is certainly not illegal, but something like com.applemaps.applemapsosx might be safer.

    Finally, no, there is probably no reason to worry about distinguishing your iPhone from your Mac app; the uniqueness domain is the individual store, Mac App store or iTunes store, just as it is the individual device, Mac or iOS device. Nevertheless it can't hurt to be safe, either!