From 9ddc173564e39acf3f68808f96f155a0d783f327 Mon Sep 17 00:00:00 2001 From: "Kristian D. Dimitrov" Date: Wed, 2 Aug 2017 19:26:49 +0300 Subject: [PATCH] Add check for application identifier ios --- lib/services/ios-project-service.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/services/ios-project-service.ts b/lib/services/ios-project-service.ts index db60e0f23f..d083538223 100644 --- a/lib/services/ios-project-service.ts +++ b/lib/services/ios-project-service.ts @@ -314,6 +314,8 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ handler, this.buildForSimulator(projectRoot, basicArgs, projectData, buildConfig.buildOutputStdio)); } + + this.validateApplicationIdentifier(projectData); } public async validatePlugins(projectData: IProjectData): Promise { @@ -1312,6 +1314,23 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f } return teamId; } + + private validateApplicationIdentifier(projectData: IProjectData): void { + const projectDir = projectData.projectDir; + const infoPlistPath = path.join(projectDir, constants.APP_FOLDER_NAME, constants.APP_RESOURCES_FOLDER_NAME, this.getPlatformData(projectData).normalizedPlatformName, this.getPlatformData(projectData).configurationFileName); + const mergedPlistPath = this.getPlatformData(projectData).configurationFilePath; + + if (!this.$fs.exists(infoPlistPath) || !this.$fs.exists(mergedPlistPath)) { + return; + } + + const infoPlist = plist.parse(this.$fs.readText(infoPlistPath)); + const mergedPlist = plist.parse(this.$fs.readText(mergedPlistPath)); + + if (infoPlist.CFBundleIdentifier && infoPlist.CFBundleIdentifier !== mergedPlist.CFBundleIdentifier) { + this.$logger.warnWithLabel("The CFBundleIdentifier key inside the 'Info.plist' will be overriden by the 'id' inside 'package.json'."); + } + } } $injector.register("iOSProjectService", IOSProjectService);