Bundle id for iOS in Xamarin forms
Look inside your info.plist
file. You'll see a key called CFBundleIdentifier
and it's in there.
Here's an example:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>My App Name</string>
<key>CFBundleName</key>
<string>MyBundleName</string>
<key>CFBundleIdentifier</key>
<string>com.example.myappidentifier</string>
<key>CFBundleShortVersionString</key>
<string>0.1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>MinimumOSVersion</key>
<string>10.0</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string>
<key>CFBundleVersion</key>
<string>47</string>
</dict>
</plist>
Other interesting keys are CFBundleShortVersionString
which have your app's version number (the marketing version number such as 1.0, 1.1.0 etc), and CFBundleVersion
which include your build number (1, 2, 3, etc).
Also note: .plist files are an XML format. You'll notice the <dict>
line that starts off a dictionary section. Inside that you'll see a series of <key>*</key>
lines, each followed by a value for that key, which could be a simple type like a string, or a more complex type like an array or even another dictionary etc. When reading/editing a .plist file, the value for each key is right below the key. In this example, the CFBundleIdentifier
has a value of com.example.myappidentifier
.
If you need to read your bundle id in code, you can add this property to a class in your Xamarin.Forms iOS project:
public String BundleId => NSBundle.MainBundle.BundleIdentifier;
Bundle identifier is defined within a Info.plist
under iOS project root.
This file is like AndroidManifest.xml
on Android.