Should bundle identifiers be lowercase or camelcase?
Asked Answered
F

3

6

Say I have an app named "Foo Bar", should the bundle identifier be com.tyilo.foobar or com.tyilo.FooBar?

What is the most normal and what does Apple do?

Futch answered 5/5, 2012 at 18:5 Comment(0)
J
4

You can do any but to make life simpler and prevent common mistakes it's just easier to keep it all lower case..

But it's entirely up to you what case you use?. The only gain from using lower case is what I mentioned above

Jailer answered 5/5, 2012 at 18:52 Comment(0)
T
2

I would make it the lower case not only to make your life simpler but also because bundles are reverse domain name and URLs are case insensitive up to and including the TLD (com/org/net) and most browsers display URLs as all lowercase.

Also if you look at Apple's sample code they use all lower case.

com.example.apple-samplecode

Tsuda answered 6/7, 2015 at 2:12 Comment(0)
J
0

According to Apple's own generation process, it can be both. Apple generates the automatic bundle ID in Xcode like this:

if your company name is Example, and...

  • your app name is "foobar", your bundle ID will be com.example.foobar
  • your app name is "FooBar", your bundle ID will be com.example.FooBar
  • your app name is "Foo Bar", your bundle ID will be com.example.Foo-Bar

Of course, you can set your own bundle ID to something else other than the default, this is just how the automatic process works.

Jeffery answered 30/1, 2023 at 12:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.