What is maximum allowed length of iOS BundleId?
Asked Answered
M

2

7

I am trying to come up with regex to validate iOS app's bundle id. This link was quite helpful. However I also need to validate length of supplied bundleid as well as length of strings between dots (here I am assuming there would be such restrictions from Apple) . For example, in bundle id 'com.company.project' I need to ensure 'company', 'project' etc are also within in allowed limit. I tried finding any apple docs that talks about maximum allowed bundle id but I couldn't. Is it like any length is allowed? Any help appreciated.

Mercia answered 27/2, 2018 at 5:35 Comment(1)
Max length of bundle id is 155 characters.Bangweulu
C
8

Apparently 155 characters.

Checked in Apple Developer Account as seen below:

BundleID

Also, it could be one long character set without .'s

Colunga answered 27/2, 2018 at 6:57 Comment(0)
O
3

From inspecting the HTML of the create App ID page on May 14, 2018, here are the constraints including a regular expression to validate the bundle identifier:

Name

  • Maximum Length: 50
  • Pattern: ^[0-9A-Za-z\d\s]+$

Bundle Identifier

  • Maximum Length: 155
  • Pattern: ^[A-Za-z0-9\.\-]+$

The original question was a regular expression to validate bundle identifiers, you could use this to do that:

^[A-Za-z0-9\.\-]{1,155}$
Oxtail answered 14/5, 2018 at 11:23 Comment(1)
I think the regex should be ^[A-Za-z0-9\.\-]{1,155}$ - no + sign. + means "1 or more".Barbarbarbara

© 2022 - 2024 — McMap. All rights reserved.