ios.netmaui

iOS Missing API Declarations warning _after_ adding privacy manifest


I still receive a warning email from Apple when I submit my .NET MAUI iOS app regarding Missing API declarations.

I have already added a PrivacyInfo.xcprivacy file in my Platforms/iOS folder. Its Build Action is BundleResource. I also modified the project file to include the relevant ItemGroup information.

The email contains exactly the same missing API declarations as before I added the privacy file: NSPrivacyAccessedAPICategoryDiskSpace, NSPrivacyAccessedAPICategoryFileTimestamp, and NSPrivacyAccessedAPICategorySystemBootTime.

Here is my PrivacyInfo.xcprivacy file:

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<!-- See https://devblogs.microsoft.com/dotnet/apple-privacy-manifest-support/ -->

<plist version="1.0">
    <dict>
        <key>NSPrivacyAccessedAPIType</key>
        <string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
        <key>NSPrivacyAccessedAPITypeReasons</key>
        <array>
            <string>C617.1</string>
        </array>
    </dict>
    <dict>
        <key>NSPrivacyAccessedAPIType</key>
        <string>NSPrivacyAccessedAPICategorySystemBootTime</string>
        <key>NSPrivacyAccessedAPITypeReasons</key>
        <array>
            <string>35F9.1</string>
        </array>
    </dict>
    <dict>
        <key>NSPrivacyAccessedAPIType</key>
        <string>NSPrivacyAccessedAPICategoryDiskSpace</string>
        <key>NSPrivacyAccessedAPITypeReasons</key>
        <array>
            <string>E174.1</string>
        </array>
    </dict>
</plist>

Does anyone know why this is happening?


Solution

  • Apple is introducing a privacy policy for including privacy manifest files in new and updated applications targeted for iOS, iPadOS, and tvOS platforms on the App Store.

    The privacy manifest file is a property list that records the types of data collected by your app or third-party SDK, and the required reasons APIs your app or third-party SDK uses.

    For .NET MAUI Applications

    First add a PrivacyInfo.xcprivacy as BundleResources in the Platforms/iOS folder.(Ensure that the PrivacyInfo.xcprivacy file doesn't have an .xml extension.)

    Then add required entries to the privacy manifest. Don't miss the NSPrivacyAccessedAPITypes key.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>NSPrivacyAccessedAPITypes</key>
        <array>
            <dict>
                <key>NSPrivacyAccessedAPIType</key>
                <string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
                <key>NSPrivacyAccessedAPITypeReasons</key>
                <array>
                    <string>C617.1</string>
                </array>
            </dict>
            <dict>
                <key>NSPrivacyAccessedAPIType</key>
                <string>NSPrivacyAccessedAPICategorySystemBootTime</string>
                <key>NSPrivacyAccessedAPITypeReasons</key>
                <array>
                    <string>35F9.1</string>
                </array>
            </dict>
            <dict>
                <key>NSPrivacyAccessedAPIType</key>
                <string>NSPrivacyAccessedAPICategoryDiskSpace</string>
                <key>NSPrivacyAccessedAPITypeReasons</key>
                <array>
                    <string>E174.1</string>
                </array>
            </dict>       
        </array>
    </dict>
    </plist>
    

    You may also edit your .NET MAUI project file to include the below section.

    <ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">
        <BundleResource Include="Platforms\iOS\PrivacyInfo.xcprivacy" LogicalName="PrivacyInfo.xcprivacy" />
    </ItemGroup>
    

    For more info, please refer to

    Adding Apple Privacy Manifest Support to .NET iOS & .NET MAUI apps,

    Apple privacy manifest.

    Hope it helps!