Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is maximum allowed length of iOS BundleId?

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.

like image 624
rentedrainbow Avatar asked Feb 27 '18 05:02

rentedrainbow


People also ask

What is iOS Bundleid?

The Apple bundle ID is a unique identifier associated with iOS apps. App owners set this ID. Apple recommends that app owners name the ID using a reverse domain-name notation. Example: com.domain.appname.

Is bundle ID case sensitive iOS?

Bundle IDs are case sensitive.

What is a valid bundle identifier?

A bundle ID uniquely identifies a single app throughout the system. The bundle ID string must contain only alphanumeric characters (A–Z, a–z, and 0–9), hyphens (-), and periods (.). Typically, you use a reverse-DNS format for bundle ID strings. Bundle IDs are case-insensitive.

Where is Bundleid of iOS app in XCode?

Open you project with XCode, select the top project item in the project navigator at the left. Then select TARGETS -> General. Bundle Identifier is found under Identity.


2 Answers

Apparently 155 characters.

Checked in Apple Developer Account as seen below:

BundleID

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

like image 94
staticVoidMan Avatar answered Nov 02 '22 23:11

staticVoidMan


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}$
like image 41
Sam Soffes Avatar answered Nov 02 '22 23:11

Sam Soffes