From 86c6c5b3a44a7cecdac94d35f8599ec5ca713aa9 Mon Sep 17 00:00:00 2001 From: achkars <34329790+achkars@users.noreply.github.com> Date: Fri, 23 Jan 2026 21:31:02 -0500 Subject: [PATCH 1/4] Repalce unique_id and suffix with bundle_identifier Add BUNDLE_IDENTIFIER Replace unique_id var with BUNDLE_IDENTIFIER --- Config.xcconfig | 10 ++++-- LoopFollow.xcodeproj/project.pbxproj | 4 +-- LoopFollow/Helpers/AppConstants.swift | 2 +- LoopFollow/Info.plist | 6 ++-- fastlane/Fastfile | 47 ++++++++++++++++++++++----- 5 files changed, 51 insertions(+), 18 deletions(-) diff --git a/Config.xcconfig b/Config.xcconfig index 04c70065d..b5dc24dee 100644 --- a/Config.xcconfig +++ b/Config.xcconfig @@ -1,9 +1,13 @@ -#include? "LoopFollowConfigOverride.xcconfig" -#include? "../../LoopFollowConfigOverride.xcconfig" +//#include? "LoopFollowConfigOverride.xcconfig" +//#include? "../../LoopFollowConfigOverride.xcconfig" #include? "LoopFollowDisplayNameConfig.xcconfig" #include? "../../LoopFollowDisplayNameConfig.xcconfig" -unique_id = ${DEVELOPMENT_TEAM} +//Bundle Identifier must be formatted like: com.$(DEVELOPMENT_TEAM).LoopFollow +//$(DEVELOPMENT_TEAM) will be repalced by the TEAMID repository secret during build phase. +BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).AA.LoopFollow +//BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).LoopFollow.Second +//BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).LoopFollow.Third //Version (DEFAULT) LOOP_FOLLOW_MARKETING_VERSION = 4.4.3 diff --git a/LoopFollow.xcodeproj/project.pbxproj b/LoopFollow.xcodeproj/project.pbxproj index 035544902..b3a984b6e 100644 --- a/LoopFollow.xcodeproj/project.pbxproj +++ b/LoopFollow.xcodeproj/project.pbxproj @@ -2400,7 +2400,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "com.$(unique_id).LoopFollow$(app_suffix)"; + PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER)"; PRODUCT_NAME = "Loop Follow"; SUPPORTS_MACCATALYST = YES; SWIFT_VERSION = 5.0; @@ -2423,7 +2423,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "com.$(unique_id).LoopFollow$(app_suffix)"; + PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER)"; PRODUCT_NAME = "Loop Follow"; SUPPORTS_MACCATALYST = YES; SWIFT_VERSION = 5.0; diff --git a/LoopFollow/Helpers/AppConstants.swift b/LoopFollow/Helpers/AppConstants.swift index e81ba159c..ee52e2bf4 100644 --- a/LoopFollow/Helpers/AppConstants.swift +++ b/LoopFollow/Helpers/AppConstants.swift @@ -5,7 +5,7 @@ import Foundation // Class that contains general constants used in different classes class AppConstants { - static let APP_GROUP_ID = "group.com.$(unique_id).LoopFollow" + static let APP_GROUP_ID = "group.$(BUNDLE_IDENTIFIER)" /// Extracts the app suffix from the bundle identifier /// Bundle identifier format: com.$(unique_id).LoopFollow$(app_suffix) diff --git a/LoopFollow/Info.plist b/LoopFollow/Info.plist index e76068f9a..d51dcefca 100644 --- a/LoopFollow/Info.plist +++ b/LoopFollow/Info.plist @@ -3,10 +3,10 @@ AppGroupIdentifier - group.com.$(unique_id).LoopFollow$(app_suffix) + group.$(BUNDLE_IDENTIFIER) BGTaskSchedulerPermittedIdentifiers - com.$(unique_id).LoopFollow$(app_suffix) + $(BUNDLE_IDENTIFIER) CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) @@ -17,7 +17,7 @@ CFBundleGetInfoString CFBundleIdentifier - com.$(unique_id).LoopFollow$(app_suffix) + $(BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/fastlane/Fastfile b/fastlane/Fastfile index d81e60e5d..7041a1c7a 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -23,11 +23,37 @@ DEVICE_NAME = ENV["DEVICE_NAME"] DEVICE_ID = ENV["DEVICE_ID"] ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "120" +# Define method to parse xcconfig file, and replace $(DEVELOPMENT_TEAM) with ENV["TEAMID"] +def parse_xcconfig_file(path) + xcconfig = {} + File.open(path).each_line do |line| + line.strip! + next if line.empty? || line.start_with?('//') + parts = line.split('=') + next if parts.length < 2 # Skip lines without '=' + key, value = parts.map(&:strip) + # Replace $(DEVELOPMENT_TEAM) with ENV["TEAMID"] + value = value.gsub('$(DEVELOPMENT_TEAM)', TEAMID) + xcconfig[key] = value + end + xcconfig + end + +# Path to config.xcconfig file +xcconfig_path = "#{GITHUB_WORKSPACE}/Config.xcconfig" + +# Load the variables from config.xcconfig +xcconfig = parse_xcconfig_file(xcconfig_path) + +# Access BUNDLE_IDENTIFIER from the xcconfig file after replacing $(DEVELOPMENT_TEAM) with ENV["TEAMID"] +ENV["BUNDLE_ID"] = xcconfig["BUNDLE_IDENTIFIER"] + platform :ios do desc "Build Loop Follow" lane :build_LoopFollow do setup_ci if ENV['CI'] - + BUNDLE_ID = ENV["BUNDLE_ID"] + update_project_team( path: "#{GITHUB_WORKSPACE}/LoopFollow.xcodeproj", teamid: "#{TEAMID}" @@ -40,7 +66,7 @@ platform :ios do ) previous_build_number = latest_testflight_build_number( - app_identifier: "com.#{TEAMID}.LoopFollow", + app_identifier: "#{BUNDLE_ID}", api_key: api_key, ) @@ -55,7 +81,7 @@ platform :ios do type: "appstore", git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"), app_identifier: [ - "com.#{TEAMID}.LoopFollow" + "#{BUNDLE_ID}" ] ) @@ -65,7 +91,7 @@ platform :ios do update_code_signing_settings( path: "#{GITHUB_WORKSPACE}/LoopFollow.xcodeproj", - profile_name: mapping["com.#{TEAMID}.LoopFollow"], + profile_name: mapping["#{BUNDLE_ID}"], code_sign_identity: "iPhone Distribution", targets: ["LoopFollow"] ) @@ -105,7 +131,8 @@ platform :ios do lane :identifiers do setup_ci if ENV['CI'] ENV["MATCH_READONLY"] = false.to_s - + BUNDLE_ID = ENV["BUNDLE_ID"] + app_store_connect_api_key( key_id: "#{FASTLANE_KEY_ID}", issuer_id: "#{FASTLANE_ISSUER_ID}", @@ -124,7 +151,7 @@ platform :ios do end end - configure_bundle_id("LoopFollow", "com.#{TEAMID}.LoopFollow", [ + configure_bundle_id("LoopFollow", "#{BUNDLE_ID}", [ Spaceship::ConnectAPI::BundleIdCapability::Type::PUSH_NOTIFICATIONS ]) @@ -134,7 +161,8 @@ platform :ios do lane :certs do setup_ci if ENV['CI'] ENV["MATCH_READONLY"] = false.to_s - + BUNDLE_ID = ENV["BUNDLE_ID"] + app_store_connect_api_key( key_id: "#{FASTLANE_KEY_ID}", issuer_id: "#{FASTLANE_ISSUER_ID}", @@ -147,7 +175,7 @@ platform :ios do verbose: true, git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"), app_identifier: [ - "com.#{TEAMID}.LoopFollow", + "#{BUNDLE_ID}", ] ) end @@ -156,6 +184,7 @@ platform :ios do lane :validate_secrets do setup_ci if ENV['CI'] ENV["MATCH_READONLY"] = true.to_s + BUNDLE_ID = ENV["BUNDLE_ID"] app_store_connect_api_key( key_id: "#{FASTLANE_KEY_ID}", @@ -167,7 +196,7 @@ platform :ios do bundle_id = Spaceship::ConnectAPI::BundleId.find(identifier) end - find_bundle_id("com.#{TEAMID}.loopkit.LoopFollow") + find_bundle_id("#{BUNDLE_ID}") match( type: "appstore", From 8fd453a609cb0534292761e97dea44372f3df97d Mon Sep 17 00:00:00 2001 From: achkars <34329790+achkars@users.noreply.github.com> Date: Fri, 23 Jan 2026 23:02:02 -0500 Subject: [PATCH 2/4] Testing bundle_identifier --- Config.xcconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Config.xcconfig b/Config.xcconfig index b5dc24dee..18020b155 100644 --- a/Config.xcconfig +++ b/Config.xcconfig @@ -5,7 +5,7 @@ //Bundle Identifier must be formatted like: com.$(DEVELOPMENT_TEAM).LoopFollow //$(DEVELOPMENT_TEAM) will be repalced by the TEAMID repository secret during build phase. -BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).AA.LoopFollow +BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).LoopFollow //BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).LoopFollow.Second //BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).LoopFollow.Third From 6f504fc2e362d5d78502e2e49b03d826ee968d87 Mon Sep 17 00:00:00 2001 From: achkars <34329790+achkars@users.noreply.github.com> Date: Fri, 23 Jan 2026 21:31:02 -0500 Subject: [PATCH 3/4] Replace unique_id and suffix with bundle_identifier Add BUNDLE_IDENTIFIER Replace unique_id var with BUNDLE_IDENTIFIER --- Config.xcconfig | 10 ++++-- LoopFollow.xcodeproj/project.pbxproj | 4 +-- LoopFollow/Helpers/AppConstants.swift | 2 +- LoopFollow/Info.plist | 6 ++-- fastlane/Fastfile | 47 ++++++++++++++++++++++----- 5 files changed, 51 insertions(+), 18 deletions(-) diff --git a/Config.xcconfig b/Config.xcconfig index 04c70065d..18020b155 100644 --- a/Config.xcconfig +++ b/Config.xcconfig @@ -1,9 +1,13 @@ -#include? "LoopFollowConfigOverride.xcconfig" -#include? "../../LoopFollowConfigOverride.xcconfig" +//#include? "LoopFollowConfigOverride.xcconfig" +//#include? "../../LoopFollowConfigOverride.xcconfig" #include? "LoopFollowDisplayNameConfig.xcconfig" #include? "../../LoopFollowDisplayNameConfig.xcconfig" -unique_id = ${DEVELOPMENT_TEAM} +//Bundle Identifier must be formatted like: com.$(DEVELOPMENT_TEAM).LoopFollow +//$(DEVELOPMENT_TEAM) will be repalced by the TEAMID repository secret during build phase. +BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).LoopFollow +//BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).LoopFollow.Second +//BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).LoopFollow.Third //Version (DEFAULT) LOOP_FOLLOW_MARKETING_VERSION = 4.4.3 diff --git a/LoopFollow.xcodeproj/project.pbxproj b/LoopFollow.xcodeproj/project.pbxproj index 035544902..b3a984b6e 100644 --- a/LoopFollow.xcodeproj/project.pbxproj +++ b/LoopFollow.xcodeproj/project.pbxproj @@ -2400,7 +2400,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "com.$(unique_id).LoopFollow$(app_suffix)"; + PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER)"; PRODUCT_NAME = "Loop Follow"; SUPPORTS_MACCATALYST = YES; SWIFT_VERSION = 5.0; @@ -2423,7 +2423,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "com.$(unique_id).LoopFollow$(app_suffix)"; + PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER)"; PRODUCT_NAME = "Loop Follow"; SUPPORTS_MACCATALYST = YES; SWIFT_VERSION = 5.0; diff --git a/LoopFollow/Helpers/AppConstants.swift b/LoopFollow/Helpers/AppConstants.swift index e81ba159c..ee52e2bf4 100644 --- a/LoopFollow/Helpers/AppConstants.swift +++ b/LoopFollow/Helpers/AppConstants.swift @@ -5,7 +5,7 @@ import Foundation // Class that contains general constants used in different classes class AppConstants { - static let APP_GROUP_ID = "group.com.$(unique_id).LoopFollow" + static let APP_GROUP_ID = "group.$(BUNDLE_IDENTIFIER)" /// Extracts the app suffix from the bundle identifier /// Bundle identifier format: com.$(unique_id).LoopFollow$(app_suffix) diff --git a/LoopFollow/Info.plist b/LoopFollow/Info.plist index e76068f9a..d51dcefca 100644 --- a/LoopFollow/Info.plist +++ b/LoopFollow/Info.plist @@ -3,10 +3,10 @@ AppGroupIdentifier - group.com.$(unique_id).LoopFollow$(app_suffix) + group.$(BUNDLE_IDENTIFIER) BGTaskSchedulerPermittedIdentifiers - com.$(unique_id).LoopFollow$(app_suffix) + $(BUNDLE_IDENTIFIER) CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) @@ -17,7 +17,7 @@ CFBundleGetInfoString CFBundleIdentifier - com.$(unique_id).LoopFollow$(app_suffix) + $(BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/fastlane/Fastfile b/fastlane/Fastfile index d81e60e5d..7041a1c7a 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -23,11 +23,37 @@ DEVICE_NAME = ENV["DEVICE_NAME"] DEVICE_ID = ENV["DEVICE_ID"] ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "120" +# Define method to parse xcconfig file, and replace $(DEVELOPMENT_TEAM) with ENV["TEAMID"] +def parse_xcconfig_file(path) + xcconfig = {} + File.open(path).each_line do |line| + line.strip! + next if line.empty? || line.start_with?('//') + parts = line.split('=') + next if parts.length < 2 # Skip lines without '=' + key, value = parts.map(&:strip) + # Replace $(DEVELOPMENT_TEAM) with ENV["TEAMID"] + value = value.gsub('$(DEVELOPMENT_TEAM)', TEAMID) + xcconfig[key] = value + end + xcconfig + end + +# Path to config.xcconfig file +xcconfig_path = "#{GITHUB_WORKSPACE}/Config.xcconfig" + +# Load the variables from config.xcconfig +xcconfig = parse_xcconfig_file(xcconfig_path) + +# Access BUNDLE_IDENTIFIER from the xcconfig file after replacing $(DEVELOPMENT_TEAM) with ENV["TEAMID"] +ENV["BUNDLE_ID"] = xcconfig["BUNDLE_IDENTIFIER"] + platform :ios do desc "Build Loop Follow" lane :build_LoopFollow do setup_ci if ENV['CI'] - + BUNDLE_ID = ENV["BUNDLE_ID"] + update_project_team( path: "#{GITHUB_WORKSPACE}/LoopFollow.xcodeproj", teamid: "#{TEAMID}" @@ -40,7 +66,7 @@ platform :ios do ) previous_build_number = latest_testflight_build_number( - app_identifier: "com.#{TEAMID}.LoopFollow", + app_identifier: "#{BUNDLE_ID}", api_key: api_key, ) @@ -55,7 +81,7 @@ platform :ios do type: "appstore", git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"), app_identifier: [ - "com.#{TEAMID}.LoopFollow" + "#{BUNDLE_ID}" ] ) @@ -65,7 +91,7 @@ platform :ios do update_code_signing_settings( path: "#{GITHUB_WORKSPACE}/LoopFollow.xcodeproj", - profile_name: mapping["com.#{TEAMID}.LoopFollow"], + profile_name: mapping["#{BUNDLE_ID}"], code_sign_identity: "iPhone Distribution", targets: ["LoopFollow"] ) @@ -105,7 +131,8 @@ platform :ios do lane :identifiers do setup_ci if ENV['CI'] ENV["MATCH_READONLY"] = false.to_s - + BUNDLE_ID = ENV["BUNDLE_ID"] + app_store_connect_api_key( key_id: "#{FASTLANE_KEY_ID}", issuer_id: "#{FASTLANE_ISSUER_ID}", @@ -124,7 +151,7 @@ platform :ios do end end - configure_bundle_id("LoopFollow", "com.#{TEAMID}.LoopFollow", [ + configure_bundle_id("LoopFollow", "#{BUNDLE_ID}", [ Spaceship::ConnectAPI::BundleIdCapability::Type::PUSH_NOTIFICATIONS ]) @@ -134,7 +161,8 @@ platform :ios do lane :certs do setup_ci if ENV['CI'] ENV["MATCH_READONLY"] = false.to_s - + BUNDLE_ID = ENV["BUNDLE_ID"] + app_store_connect_api_key( key_id: "#{FASTLANE_KEY_ID}", issuer_id: "#{FASTLANE_ISSUER_ID}", @@ -147,7 +175,7 @@ platform :ios do verbose: true, git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"), app_identifier: [ - "com.#{TEAMID}.LoopFollow", + "#{BUNDLE_ID}", ] ) end @@ -156,6 +184,7 @@ platform :ios do lane :validate_secrets do setup_ci if ENV['CI'] ENV["MATCH_READONLY"] = true.to_s + BUNDLE_ID = ENV["BUNDLE_ID"] app_store_connect_api_key( key_id: "#{FASTLANE_KEY_ID}", @@ -167,7 +196,7 @@ platform :ios do bundle_id = Spaceship::ConnectAPI::BundleId.find(identifier) end - find_bundle_id("com.#{TEAMID}.loopkit.LoopFollow") + find_bundle_id("#{BUNDLE_ID}") match( type: "appstore", From 0364a48555077c576a5a2109442f8ea28cb5c037 Mon Sep 17 00:00:00 2001 From: achkars <34329790+achkars@users.noreply.github.com> Date: Fri, 23 Jan 2026 23:04:30 -0500 Subject: [PATCH 4/4] xx --- Config.xcconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Config.xcconfig b/Config.xcconfig index 18020b155..e0a30fc99 100644 --- a/Config.xcconfig +++ b/Config.xcconfig @@ -4,7 +4,7 @@ #include? "../../LoopFollowDisplayNameConfig.xcconfig" //Bundle Identifier must be formatted like: com.$(DEVELOPMENT_TEAM).LoopFollow -//$(DEVELOPMENT_TEAM) will be repalced by the TEAMID repository secret during build phase. +//$(DEVELOPMENT_TEAM) will be replaced by the TEAMID repository secret during build phase. BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).LoopFollow //BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).LoopFollow.Second //BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).LoopFollow.Third