Skip to content

Commit 81488de

Browse files
KristianDDPlamen5kov
authored andcommitted
Add check for application identifier ios (#3033)
1 parent e35de42 commit 81488de

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

lib/services/ios-project-service.ts

+19
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,8 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
314314
handler,
315315
this.buildForSimulator(projectRoot, basicArgs, projectData, buildConfig.buildOutputStdio));
316316
}
317+
318+
this.validateApplicationIdentifier(projectData);
317319
}
318320

319321
public async validatePlugins(projectData: IProjectData): Promise<void> {
@@ -1312,6 +1314,23 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
13121314
}
13131315
return teamId;
13141316
}
1317+
1318+
private validateApplicationIdentifier(projectData: IProjectData): void {
1319+
const projectDir = projectData.projectDir;
1320+
const infoPlistPath = path.join(projectDir, constants.APP_FOLDER_NAME, constants.APP_RESOURCES_FOLDER_NAME, this.getPlatformData(projectData).normalizedPlatformName, this.getPlatformData(projectData).configurationFileName);
1321+
const mergedPlistPath = this.getPlatformData(projectData).configurationFilePath;
1322+
1323+
if (!this.$fs.exists(infoPlistPath) || !this.$fs.exists(mergedPlistPath)) {
1324+
return;
1325+
}
1326+
1327+
const infoPlist = plist.parse(this.$fs.readText(infoPlistPath));
1328+
const mergedPlist = plist.parse(this.$fs.readText(mergedPlistPath));
1329+
1330+
if (infoPlist.CFBundleIdentifier && infoPlist.CFBundleIdentifier !== mergedPlist.CFBundleIdentifier) {
1331+
this.$logger.warnWithLabel("The CFBundleIdentifier key inside the 'Info.plist' will be overriden by the 'id' inside 'package.json'.");
1332+
}
1333+
}
13151334
}
13161335

13171336
$injector.register("iOSProjectService", IOSProjectService);

0 commit comments

Comments
 (0)