From 560d330059381063da8e1990b0c344d4843717a0 Mon Sep 17 00:00:00 2001 From: Luis Padron Date: Fri, 17 Apr 2026 13:41:39 -0400 Subject: [PATCH] feat(ios): make app bundle identifier configurable at build time (#354) --- mobile/ios/.gitignore | 1 + mobile/ios/Flutter/Debug.xcconfig | 7 +++++++ mobile/ios/Flutter/Release.xcconfig | 7 +++++++ mobile/ios/Runner.xcodeproj/project.pbxproj | 12 ++++++------ 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/mobile/ios/.gitignore b/mobile/ios/.gitignore index 7a7f9873ad..6547384f35 100644 --- a/mobile/ios/.gitignore +++ b/mobile/ios/.gitignore @@ -16,6 +16,7 @@ profile xcuserdata **/.generated/ Flutter/App.framework +Flutter/AppOverrides.xcconfig Flutter/Flutter.framework Flutter/Flutter.podspec Flutter/Generated.xcconfig diff --git a/mobile/ios/Flutter/Debug.xcconfig b/mobile/ios/Flutter/Debug.xcconfig index ec97fc6f30..e18fefd80e 100644 --- a/mobile/ios/Flutter/Debug.xcconfig +++ b/mobile/ios/Flutter/Debug.xcconfig @@ -1,2 +1,9 @@ #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" + +// Default app bundle identifier. Internal/custom builds can override this +// without patching tracked files by writing +// `mobile/ios/Flutter/AppOverrides.xcconfig` containing +// `BUNDLE_IDENTIFIER = your.app.id` (gitignored). +BUNDLE_IDENTIFIER = com.sprout.sproutMobile +#include? "AppOverrides.xcconfig" diff --git a/mobile/ios/Flutter/Release.xcconfig b/mobile/ios/Flutter/Release.xcconfig index c4855bfe20..f0767b0e5c 100644 --- a/mobile/ios/Flutter/Release.xcconfig +++ b/mobile/ios/Flutter/Release.xcconfig @@ -1,2 +1,9 @@ #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" + +// Default app bundle identifier. Internal/custom builds can override this +// without patching tracked files by writing +// `mobile/ios/Flutter/AppOverrides.xcconfig` containing +// `BUNDLE_IDENTIFIER = your.app.id` (gitignored). +BUNDLE_IDENTIFIER = com.sprout.sproutMobile +#include? "AppOverrides.xcconfig" diff --git a/mobile/ios/Runner.xcodeproj/project.pbxproj b/mobile/ios/Runner.xcodeproj/project.pbxproj index c25c4edc41..51f326c89d 100644 --- a/mobile/ios/Runner.xcodeproj/project.pbxproj +++ b/mobile/ios/Runner.xcodeproj/project.pbxproj @@ -482,7 +482,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.sprout.sproutMobile; + PRODUCT_BUNDLE_IDENTIFIER = $(BUNDLE_IDENTIFIER); PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -499,7 +499,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.sprout.sproutMobile.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = $(BUNDLE_IDENTIFIER).RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -517,7 +517,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.sprout.sproutMobile.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = $(BUNDLE_IDENTIFIER).RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -533,7 +533,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.sprout.sproutMobile.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = $(BUNDLE_IDENTIFIER).RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -665,7 +665,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.sprout.sproutMobile; + PRODUCT_BUNDLE_IDENTIFIER = $(BUNDLE_IDENTIFIER); PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -688,7 +688,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.sprout.sproutMobile; + PRODUCT_BUNDLE_IDENTIFIER = $(BUNDLE_IDENTIFIER); PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0;