OS X Bundle Identifier name: Best practice in this situation
Asked Answered
T

1

10

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

Terrijo answered 15/11, 2016 at 21:3 Comment(1)
take care that you bundle id must be different for you ios and macos app !Quita
S
9

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!

Sclerotomy answered 15/11, 2016 at 21:9 Comment(5)
Will users see my bundle identifier for the OS X App?Terrijo
They can if they want to. I would say most users have no idea how to do that, though.Sclerotomy
I don't care for the bundle identifier name I have. I already uploaded a build and seem to not be able to change it. the name I assigned it is com.appname.macTerrijo
@Weakman10122: You should only use the com.appname prefix if you own the domain appname.com. That's the point of the reverse DNS convention: the owner of something.com is responsible for making sure there are no duplicates that start with com.something, the owner of something.org is responsible for org.something.*, and the owner of something.co.uk is responsible for uk.co.something.*.Perspicuous
"I already uploaded a build and seem to not be able to change it" Yes, well, the bundle name is the identifier for the app, so there is nothing to change. To put it another way, once you've made Apple aware of an app, the bundle id is the one thing that cannot change. It is the app in every meaningful sense. I'm pretty sure I said something like "unique identifier" in my answer...Sclerotomy

© 2022 - 2024 — McMap. All rights reserved.