Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check Apple Privacy Manifest requirements #1738

Closed
jfversluis opened this issue Mar 8, 2024 · 24 comments
Closed

Check Apple Privacy Manifest requirements #1738

jfversluis opened this issue Mar 8, 2024 · 24 comments
Labels
area/core Issue/Discussion/PR that has to do with the core of the toolkit

Comments

@jfversluis
Copy link
Member

jfversluis commented Mar 8, 2024

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

We should check if we're using one of the APIs that needs an entry in a Privacy Manifest and provide our users with guidance and/or include a manifest in our own library.

We probably also need to check this for the Xamarin Community Toolkit.

@jfversluis jfversluis added bug Something isn't working unverified and removed bug Something isn't working unverified labels Mar 8, 2024
@maonaoda
Copy link

Can the priority of this be increased?

@owaits
Copy link

owaits commented Mar 14, 2024

Its worth noting that from the 1st May 2024 this will be a requirement. This is what I received when submitting an app for review.

"While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, you must include a NSPrivacyAccessedAPITypes array in your app’s privacy manifest to provide approved reasons for these APIs used by your app’s code."

If adding native support will take too long then at very least have some documentation on how you add such a file to your maui project.

@jfversluis
Copy link
Member Author

We're very aware and work is being done, no worries. This also transcends just the Toolkit. You can see instructions we're working on here: xamarin/xamarin-macios#20292

@jfversluis
Copy link
Member Author

@owaits if I may, we would love to double-check if this works for your scenario. Could I maybe ask you...

  • A list of the dependencies you are using in your project
  • To try and follow the instructions in the linked PR above and let us know if that is clear
  • Let us know what the contents of your privacy manifest look like
  • And if that stops triggering this message (in other words: you are now compliant)

@owaits
Copy link

owaits commented Mar 14, 2024

A list of the dependencies you are using in your project

I have attached the linker output from the Android build, does this give you the dependancy information you need? We have quite complicated project structure with lots of interlinked dependencies. They also all build for at least 4 different frameworks each so difficult to extract what's related to MAUI. Most of the projects date back to pre-xamarin days.

35.txt

To try and follow the instructions in the linked PR above and let us know if that is clear

I found it confusing that it starts by telling you what to put in the file and then tells you how the create the PrivacyInfo.xcprivacy file. I think I would have found it easier if it had started with "in your maui project right click in Platforms\iOS folder and add new
??" I had to add a cs file then open the plist file and copy across contents. Maybe state to paste in a template here from the docs? Then you need to edit the csproj to add the special bundle code which I initially missed.

Let us know what the contents of your privacy manifest look like

These are the changes I made after reading the docs.

csproj

<PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Release'">
    <CodesignKey>***</CodesignKey>
    <CodesignProvision>***</CodesignProvision>
    <BundleResource Include="Platforms\iOS\PrivacyInfo.xcprivacy" LogicalName="PrivacyInfo.xcprivacy" />
</PropertyGroup>

PrivacyInfo.xcprivacy

<?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>

And if that stops triggering this message (in other words: you are now compliant)

I will have to let you know on this one.

@jfversluis
Copy link
Member Author

@owaits please let us know as soon as you get a response from Apple! Or in this case we would rather not get a response... 😉

Seems like the logs contains the Android build output, but we're specifically interested in iOS here. I think just the overview from your csproj file with the libraries you're using in your project should be enough. Thanks again!

@ISSPRO-Eng
Copy link

error MSB4066: The attribute "Include" in element is unrecognized.

I am getting this error when adding it in like @owaits

@jfversluis
Copy link
Member Author

@ISSPRO-Eng could you please provide more details? What are you adding exactly and where?

@ISSPRO-Eng
Copy link

ISSPRO-Eng commented Mar 15, 2024

Adding` in the privacy manifest. I have the actual .xcprivacy file located at "My Project Name"/Platforms/iOS/PrivacyInfo.xcprivacy

I have added it in my csproj file here
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net7.0-ios|AnyCPU'"> <RuntimeIdentifier>ios-arm64</RuntimeIdentifier> <CreatePackage>false</CreatePackage> <CodesignProvision>XXX</CodesignProvision> <CodesignKey>XXX</CodesignKey> <CodesignEntitlements>Platforms\iOS\Entitlements.plist</CodesignEntitlements> <BundleResource Include="Platforms\iOS\PrivacyInfo.xcprivacy" LogicalName="PrivacyInfo.xcprivacy" /> <DeviceSpecificBuild>true</DeviceSpecificBuild> </PropertyGroup>

@ISSPRO-Eng
Copy link

ISSPRO-Eng commented Mar 15, 2024

Changed it to <BundleResource> Include="Platforms\iOS\PrivacyInfo.xcprivacy" LogicalName="PrivacyInfo.xcprivacy" </BundleResource> and everything works now

@jfversluis
Copy link
Member Author

Interesting that that makes a difference. Please let us know if that also makes the warning from Apple disappear, thanks!

@ISSPRO-Eng
Copy link

Seems that it made the warning go away for uploading to the App Store. I was instantly getting messages after uploading about compliance, but have not gotten one yet

@ISSPRO-Eng
Copy link

Anddd I got the compliance message again. Still not resolved

@jfversluis
Copy link
Member Author

@ISSPRO-Eng could you maybe provide a list of the third-party libraries you're using?

@ISSPRO-Eng
Copy link

ISSPRO-Eng commented Mar 18, 2024

ITMS-91053: Missing API declaration - Your app’s code in the “MultiGaugeAttributeProgrammer” file references one or more APIs that require reasons, including the following API categories: NSPrivacyAccessedAPICategoryFileTimestamp. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, you must include a NSPrivacyAccessedAPITypes array in your app’s privacy manifest to provide approved reasons for these APIs used by your app’s code. For more details about this policy, including a list of required reason APIs and approved reasons for usage, visit: https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api.

ITMS-91053: Missing API declaration - Your app’s code in the “MultiGaugeAttributeProgrammer” file references one or more APIs that require reasons, including the following API categories: NSPrivacyAccessedAPICategorySystemBootTime. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, you must include a NSPrivacyAccessedAPITypes array in your app’s privacy manifest to provide approved reasons for these APIs used by your app’s code. For more details about this policy, including a list of required reason APIs and approved reasons for usage, visit: https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api.

ITMS-91053: Missing API declaration - Your app’s code in the “MultiGaugeAttributeProgrammer” file references one or more APIs that require reasons, including the following API categories: NSPrivacyAccessedAPICategoryDiskSpace. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, you must include a NSPrivacyAccessedAPITypes array in your app’s privacy manifest to provide approved reasons for these APIs used by your app’s code. For more details about this policy, including a list of required reason APIs and approved reasons for usage, visit: https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api.

Apple Developer Relations

This was from Apple.

Current Packages are Community Toolkit, FFImageLoading.Maui, Laerdal.Dfu, Mopups, Maui.ColorPicker, Plugin.BLE, Shiny.BluetoothLE, SkiaSharp, SkiaSharp.svg, SkiaSharp.Views.Maui

@jfversluis
Copy link
Member Author

Thanks for the information!

Would you be able to help me out a little further?

  1. Could you confirm what the current contents are in your PrivacyManifest.xcprivacy file?
  2. Is the entry for this in your csproj still what you mentioned above? Would you be able to maybe provide the full contents of your csproj file (maybe partially redact sensitive values, but try to keep it all original as much as possible)
  3. For the ipa that you are sending for review, could you make a copy, rename it from YourApp.ipa to YourApp.zip and look inside of it and verify that the PrivacyManifest.xcprivacy is in there? And what the exact location for it is?

Trying to help you (and everyone else) get past this!

Thank you!

@ISSPRO-Eng
Copy link

Privacy Help.zip

I have attached a zip here with a mostly original .csproj and the Privacy Manifest.

I actually did not see the Privacy Manifest being bundled into the ipa file when looking at it. Wondering why that may be...

@ISSPRO-Eng
Copy link

ISSPRO-Eng commented Mar 18, 2024

I added this to the bottom of my .csproj and removed it from the iOS section.

<ItemGroup>
	  <BundleResource Include="Platforms\iOS\PrivacyInfo.xcprivacy" />
	</ItemGroup>

The PrivacyInfo document is now located at /Platforms/iOS/PrivacyInfo.xcprivacy. The documentation says the Privacy Manifest needs to be at the root of the bundle though, so it is not in the correct spot.

@mcumming
Copy link

@ISSPRO-Eng I don't see any elements in your .csproj file to handle the xcprivacy file. Can you add the following to your project and see if the PrivacyInfo.xcprivacy file is placed correctly in the bundle? And also make sure the PrivacyInfo.xcprivacy is in the Platforms\iOS\ folder,

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

@ISSPRO-Eng
Copy link

Looks like that added it to the root ^^

Will give an update after submitting to the App Store.

@mcumming
Copy link

Hi @ISSPRO-Eng any updates?

@ISSPRO-Eng
Copy link

It was accepted with no issues !

@vhugogarcia vhugogarcia added the area/core Issue/Discussion/PR that has to do with the core of the toolkit label Mar 22, 2024
@jfversluis
Copy link
Member Author

I don't think we need anything for our library. Going to verify tomorrow.

Adding discussion label so we can mention it during the standup

@jfversluis jfversluis added the needs discussion Discuss it on the next Monthly standup label Mar 26, 2024
@jfversluis
Copy link
Member Author

No special requirements for this library.

Follow the instructions here for a .NET (MAUI) app and that should be enough to also cover the .NET MAUI Community Toolkit!

@brminnick brminnick removed the needs discussion Discuss it on the next Monthly standup label May 2, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/core Issue/Discussion/PR that has to do with the core of the toolkit
Projects
None yet
Development

No branches or pull requests

7 participants