ITMS-91053: Missing API declaration

There is no need to rebuild the engine for this. An UPL script can be used to put the PrivacyInfo.xcprivacy file where it is needed and make sure this is done during the Build / Stage / Archive steps.

Here are the steps to achieve it (assuming your project is named “MyProject”):

  1. Put your PrivacyInfo.xcprivacy file in the Build/IOS/ folder.
  2. Add the following UPL script in your Source/MyProject folder, name the file AddPrivacyInfo_IOS_UPL.xml. It must be next to your MyProject.Build.cs file. This script will make sure to copy the PrivacyInfo.xcprivacy from the Build/IOS folder to the final folder used to generate the .ipa file that will be uploaded later to Apple servers:
<?xml version="1.0" encoding="utf-8"?>
<root>
    <init>
        <log text="In need of a PrivacyInfo.xcprivacy? No worries, I got you..."/>
        <!-- PluginDir is the folder where this file is... weird name, but hey, I don't make the rules! -->
        <copyFile src="$S(PluginDir)/../../Build/IOS/PrivacyInfo.xcprivacy" dst="$S(BuildDir)/PrivacyInfo.xcprivacy" />
    </init>
</root>
  1. Edit your Source/MyProject/MyProject.Build.cs file and add the following lines. This will simply add the UPL script to the Build / Stage and Archive steps:
		if (Target.Platform == UnrealTargetPlatform.IOS)
		{
			string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath);
			AdditionalPropertiesForReceipt.Add("IOSPlugin", System.IO.Path.Combine(PluginPath, "AddPrivacyInfo_IOS_UPL.xml"));
        }
  1. Package, check for the “In need of a PrivacyInfo.xcprivacy? No worries, I got you…” line in the logs and then enjoy seeing the PrivacyInfo.xcprivacy in the final .ipa file.

I am confident this can work for older version of UE, like UE4.27.

2 Likes