flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
162.21k stars 26.65k forks source link

Flutter iOS documentation to address "ITMS-91053: Missing API declaration" #145269

Open taufiq-husain opened 2 months ago

taufiq-husain commented 2 months ago

Use case

We recently submitted our Flutter app (iOS) to the AppStore and received the following email:

Hello,

We noticed one or more issues with a recent submission for App Store review for the following app:

APPNAME Version 0.2.3 Build 26 Although submission for App Store review was successful, you may want to correct the following issues in your next submission for App Store review. Once you've corrected the issues, upload a new binary to App Store Connect.

ITMS-91053: Missing API declaration - Your app’s code in the “Runner” 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 “Runner” file references one or more APIs that require reasons, including the following API categories: NSPrivacyAccessedAPICategoryUserDefaults. 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 “Runner” 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.

Apple Developer Relations

Proposal

I was hoping that Flutter documentation could guide us developers further on how to address this before May 1st, 2024. I know that Apple documentation is there but it would be very helpful for the Flutter community to show how they addressed these requirements as well as the Flutter documentation highlighting how to do it successfully.

Mounix99 commented 2 months ago

Same happened to our project

salim97 commented 1 month ago

any solution ?

Mounix99 commented 1 month ago

Seems like this solution works

esmaeeeli commented 1 month ago

Same here, it seems like the solution is not working. i even removed the new packages that i added to see if that's the problem (sign_in_with_apple) unfortunately it wasn't the case. I'm using normal flutter not flutterFlow.

darshankawar commented 1 month ago

I believe this is being tracked in https://github.com/flutter/flutter/issues/143232 in which you can follow-up for further updates. Closing this in favor of it.

talhaakbar22 commented 1 month ago

I was getting similar warnings after my upload. Seems there is still quite some time to resolve it (before May 1, 2024). I added the following keys to my Info.plist, based on [https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api](https://github.com/flutter/flutter/issues/url)

 <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>NSPrivacyAccessedAPICategoryUserDefaults</string>
          <key>NSPrivacyAccessedAPITypeReasons</key>
          <array>
               <string>CA92.1</string>
              <string>1C8F.1</string>
          </array>
      </dict>
  </array>
stuartmorgan commented 1 month ago

https://github.com/flutter/flutter/issues/131940 would probably be a better issue to follow specifically for discussion of documentation around this issue.

rajeshbdabhi commented 1 month ago

I was getting similar warnings after my upload. Seems there is still quite some time to resolve it (before May 1, 2024). I added the following keys to my Info.plist, based on [https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api](https://github.com/flutter/flutter/issues/url)

 <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>NSPrivacyAccessedAPICategoryUserDefaults</string>
          <key>NSPrivacyAccessedAPITypeReasons</key>
          <array>
               <string>CA92.1</string>
              <string>1C8F.1</string>
          </array>
      </dict>
  </array>

this is also not working for me i have also followed this. but this is also not helpful for me still getting app rejection with Missing API declaration

stuartmorgan commented 1 month ago

I would encourage anyone following this issue to read https://github.com/flutter/flutter/issues/131940#issuecomment-2006965339, particularly the warning there.

I will be hiding any comments I encounter in the Flutter issue tracker that tell people to add arbitrary contents to a privacy manifest.

jmagman commented 1 month ago

Reopening this to gather more information. @taufiq-husain @rajeshbdabhi @Mounix99 @salim97, can you attach the following info:

  1. pubspec.lock
  2. ios/Podfile Thanks!
taufiq-husain commented 1 month ago

My Podfile: Podfile.txt

My pubspec.lock file: pubspec-lock.txt

I should add a note that most people will likely search for this issue by searching for "ITMS-91053" + "Flutter/iOS" so it's a good idea to keep this thread updated. I actually wanted the Flutter team to add some documentation officially (if possible) so people would know how to do it the right way for their Flutter iOS Projects.

jmagman commented 1 month ago

That Podfile does have use_frameworks! so something in there is being built statically or it wouldn't say Your app’s code in the “Runner” file (unless Apple's warning isn't splitting out into framework names as we hoped). I want to dig into whether that static lib has a privacy manifest resource.

@taufiq-husain can you also attach your pubspec.yaml dependencies list? I don't want to recreate it from that large lock file. 🙂

stuartmorgan commented 1 month ago

@taufiq-husain Also, could you confirm whether or not you have added any native code directly to your Runner? (E.g., modified the Swift or Objective-C code in the ios/ directory yourself.)

arslancs commented 1 month ago

Anyone solved it?

rajeshbdabhi commented 1 month ago

@stuartmorgan, @darshankawar i have solved this issue and my app now approved by app store. below are steps to fix this issue

  1. open ios directory into xcode Screenshot 2024-03-20 at 7 45 20 PM
  2. select runner -> right click-> new file -> search "AppPrivacy" Screenshot 2024-03-20 at 7 41 46 PM
  3. select AppPrivacy and click -> Next Screenshot 2024-03-20 at 7 42 14 PM
  4. select all available targets then click -> create
  5. [Edit by Flutter team: see the warning in this comment] ~now open this file into any text editor and past below code into this file~
``` NSPrivacyTracking NSPrivacyAccessedAPITypes NSPrivacyAccessedAPIType NSPrivacyAccessedAPICategoryDiskSpace NSPrivacyAccessedAPITypeReasons E174.1 NSPrivacyAccessedAPIType NSPrivacyAccessedAPICategoryUserDefaults NSPrivacyAccessedAPITypeReasons 1C8F.1 NSPrivacyAccessedAPIType NSPrivacyAccessedAPICategoryFileTimestamp NSPrivacyAccessedAPITypeReasons C617.1 0A2A.1 NSPrivacyAccessedAPIType NSPrivacyAccessedAPICategorySystemBootTime NSPrivacyAccessedAPITypeReasons 8FFB.1 ```
taufiq-husain commented 1 month ago

@jmagman these are my dependencies:

pubspec.yaml ``` dependencies: animated_emoji: ^3.1.0 animated_text_kit: ^4.2.2 audio_session: ^0.1.18 auto_size_text: ^3.0.0 cached_network_image: ^3.3.1 cloud_firestore: ^4.15.8 cloud_functions: ^4.6.8 crypto: ^3.0.3 facebook_app_events: ^0.19.0 firebase_analytics: ^10.8.9 firebase_auth: ^4.17.8 firebase_core: ^2.27.0 firebase_crashlytics: ^3.4.18 firebase_storage: ^11.6.9 flutter_native_splash: ^2.3.10 flutter: sdk: flutter flutter_branch_sdk: ^7.1.0 flutter_easyloading: ^3.0.5 flutter_local_notifications: ^17.0.0 get: ^4.6.6 google_fonts: ^6.2.1 google_sign_in: ^6.2.1 http: ^1.2.0 image_cropper: ^5.0.1 image_picker: ^1.0.7 in_app_review: ^2.0.8 intl: ^0.19.0 just_audio: ^0.9.36 mutex: ^3.1.0 path_provider: ^2.1.2 permission_handler: ^11.3.0 purchases_flutter: ^6.23.0 record: ^5.0.4 share_plus: ^7.2.2 shared_preferences: ^2.2.2 simple_ripple_animation: ^0.0.9 timezone: ^0.9.2 toastification: ^1.2.1 url_launcher: ^6.2.5 video_player: ^2.8.3 wakelock_plus: ^1.1.4 dev_dependencies: flutter_lints: ^3.0.0 # flutter_native_splash: ^2.3.13 # dependency_validator: ^3.0.0 # flutter_app_name: ^0.1.0 # flutter_launcher_icons: ^0.13.1 # flutter_test: # sdk: flutter ```

@stuartmorgan

I have only made changes in the Info.plist file to accommodate Branch.io quick-links (referral system), Facebook Analytics (to check when users sign up from Facebook Ads), Google Sign-in configurations, and various other iOS-specific configurations (not external API related).

I have also made very basic changes in the AppDelegate.swift file:

AppDelegate.swift ``` import UIKit import Flutter import FirebaseCore import flutter_local_notifications @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { // This is required to make any communication available in the action isolate. FlutterLocalNotificationsPlugin.setPluginRegistrantCallback { (registry) in GeneratedPluginRegistrant.register(with: registry) } if #available(iOS 10.0, *) { UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate } FirebaseApp.configure() GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } } ```
stuartmorgan commented 1 month ago

@rajeshbdabhi Please read this comment.

jmagman commented 1 month ago

Thanks @taufiq-husain, we're digging into that particular pile of plugins now.

Copied from https://github.com/flutter/flutter/issues/131940#issuecomment-2010097142 in case folks are following this issue and not that one:

Flutter itself has a compliant privacy manifest (as far as we are aware). If you're seeing ITMS-91053: Missing API declaration - Your app’s code in the “Runner” file it could mean:

  1. You are using a static plugin (podspec contains s.static_framework = true) that has declared a privacy manifest, but you're on an older version of that package and you should update.
  2. You are using a static plugin that has not declared a privacy manifest, or has an incomplete privacy manifest. We'd really like to know exactly which plugin that is, and reach out (or you as their customer reach out) and get them to add one.
  3. Much more concerning, the static plugin is declaring a privacy manifest, but there's something we're missing about how Apple is enforcing this requirement.

If you're seeing this, before you add any workarounds you read only, we'd really like help tracking this down for everyone so no one (except plugin authors in case 2 above) need to do anything manually.

Please attach:

  1. The exact ITMS-91053 warning message(s)
  2. pubspec.yaml and pubspec.lock
  3. ios/Podfile
  4. Confirm whether or not you have added any native code directly to your Runner? (E.g., modified the Swift or Objective-C code in the ios/ directory yourself.)
  5. If you're willing, your actual built .ipa or .xcarchive file so we can look at the file structure of your plugins.

Thank you so much!

stuartmorgan commented 1 month ago

Below are the results so far from my investigation of what @taufiq-husain provided (specifically, I flutter created a project and added everything from the pubspec list here; that's not going to be identical to the real project, but it appears to reproduce build output that matches the Apple warnings):

ITMS-91053: Missing API declaration - Your app’s code in the “Runner” file references one or more APIs that require reasons, including the following API categories: NSPrivacyAccessedAPICategoryFileTimestamp.

I haven't figured out what is tripping this yet. A few dependencies use APIs in this category, but none that I have found so far that are built statically and thus would be part of Runner. nm does show a NSFileModificationDate reference in Runner, so I'll continue to investigate.

Your app’s code in the “Runner” file references one or more APIs that require reasons, including the following API categories: NSPrivacyAccessedAPICategoryUserDefaults.

permission_handler_apple has code using NSUserDefaults, and sets static_framework = true, so causes NSUserDefaults code to be in Runner. The plugin is currently not declaring that, so this could be either case 2 or case 3 at this point.

ITMS-91053: Missing API declaration - Your app’s code in the “Runner” file references one or more APIs that require reasons, including the following API categories: NSPrivacyAccessedAPICategorySystemBootTime.

I see no uses of systemUptime, and only two calls to mach_absolute_time, in the project. Both mach_absolute_time calls are in things bundled as frameworks. However, nm does show a mach_absolute_time reference in Runner, so I'll continue to investigate.

(I've verified that a simple flutter create flutter build ios does not result in a Runner with those same symbol references in the binary, so it's not inherent to Flutter.)

taufiq-husain commented 1 month ago

So this issue is arising specifically from third-party packages on Flutter? Is there a way to encourage ALL package developers to address them ASAP? May 1st is Apple's deadline.

deepak-agendaboa commented 1 month ago

Just to clarify: We don't have to add the privacy manifest in the Flutter app. It has to be done by third party SDK, right?

It is confusing because almost all places saying to add the privacy manifest. For e.g see this SO https://stackoverflow.com/questions/78163859/itms-91053-missing-api-declaration-privacy

We have the following code in the AppDelegate.swift

import UIKit
import Flutter

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    GeneratedPluginRegistrant.register(with: self)

    if #available(iOS 10.0, *) {
      UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
    }

    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}
stuartmorgan commented 1 month ago

Just to clarify: We don't have to add the privacy manifest in the Flutter app. It has to be done by third party SDK, right?

  1. For SDKs which are bundled as frameworks in the final application, that is our current understanding based on the docs.
  2. For SDKs which are built statically into applications, we are still gathering information about how the enforcement is currently working in order to attempt to clarify that with Apple.

I currently believe that the initial reporter's warning messages fall under case 2, based on the wording and my investigation so far. That is not going to be the case for every application. Each case is potentially different.

deepak-agendaboa commented 1 month ago

Here are the dependencies used in our project:

pubspec.yaml ``` dependencies: flutter: sdk: flutter flutter_localizations: sdk: flutter intl: flutter_keyboard_visibility: 5.4.1 provider: 6.1.1 url_launcher: 6.2.4 bot_toast: 4.1.3 visibility_detector: 0.4.0+2 flutter_svg: 2.0.9 firebase_core: 2.27.0 firebase_auth: 4.17.8 firebase_analytics: 10.8.9 firebase_crashlytics: 3.4.18 #web support pending firebase_database: 10.4.9 firebase_storage: 11.6.9 firebase_dynamic_links: 5.4.17 #web support pending firebase_messaging: 14.7.19 firebase_in_app_messaging: 0.7.4+17 #web support pending firebase_remote_config: 4.3.17 cloud_firestore: 4.15.8 cloud_functions: 4.6.8 flutter_switch: 0.3.2 shared_preferences: 2.2.2 json_annotation: 4.8.1 collection: 1.18.0 image_picker: 1.0.7 image_cropper: 5.0.0 cached_network_image: 3.3.1 flutter_cache_manager: 3.3.1 diacritic: 0.1.5 flutter_sticky_header: 0.6.3 intercom_flutter: 8.1.1 device_info_plus: 9.1.2 crypto: 3.0.3 encrypt: 5.0.1 numberpicker: 2.1.2 pdf: 3.10.4 printing: 5.11.0 image: 4.1.6 flutter_signature_pad: 3.0.1 share_plus: 7.2.2 async: 2.11.0 connectivity_plus: 5.0.2 auto_size_text: 3.0.0 charts_flutter: 0.12.0 styled_text: 7.0.0 flutter_udid: 2.0.1 #no web support, used fingerprintjs for web fingerprintjs: 2.0.0 #only for web flutter_local_notifications: 16.3.2 #web support pending search_cep: 4.0.2 permission_handler: 11.2.0 #no web functionality flutter_contact: 0.9.1+8 #no web functionality hive: 2.2.3 hive_flutter: 1.1.0 sliver_tools: 0.2.12 in_app_purchase: 3.1.13 scroll_to_index: 3.0.1 xml: 6.5.0 youtube_player_iframe: 4.0.4 url_strategy: 0.2.0 flutter_multi_formatter: 2.11.1 credit_card_validator: 2.1.0 package_info_plus: 5.0.1 http: 1.0.0 smooth_page_indicator: 1.1.0 mobile_scanner: 3.0.0-beta.1 file_picker: 6.1.1 in_app_review: 2.0.8 rxdart: 0.27.7 sqflite: 2.3.2 path_provider: 2.1.2 flutter_spinkit: 5.2.0 flutter_rating_bar: 4.0.1 ripple_navigation: git: url: https://github.com/agendaboa/ripple_navigation ref: agendaboa_adjustments open_mail_app: 0.4.5 #no web functionality webview_flutter: 4.4.4 web: '>=0.3.0 <0.6.0' facebook_app_events: git: url: https://github.com/oddbit/flutter_facebook_app_events ref: e09af327fd36d21e423ebb54f17944fb10065416 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.0 ```
stuartmorgan commented 1 month ago

ITMS-91053: Missing API declaration - Your app’s code in the “Runner” file references one or more APIs that require reasons, including the following API categories: NSPrivacyAccessedAPICategoryFileTimestamp.

I haven't figured out what is tripping this yet. A few dependencies use APIs in this category, but none that I have found so far that are built statically and thus would be part of Runner. nm does show a NSFileModificationDate reference in Runner, so I'll continue to investigate.

I'm pretty sure I found the source of this one: facebook_app_events is a static_framework which includes a dependency on the FBAudienceNetwork Pod, which in turn has "vendored_frameworks": "Static/FBAudienceNetwork.xcframework". That precompiled framework has a reference to NSFileModificationDate.

stuartmorgan commented 1 month ago

In fact, FBAudienceNetwork is enough to cause all three of these warnings just by itself. They have published an updated version of that static framework (6.15) with a privacy manifest, and it includes NSPrivacyAccessedAPICategoryUserDefaults, NSPrivacyAccessedAPICategorySystemBootTime, and NSPrivacyAccessedAPICategoryFileTimestamp.

Hopefully once https://github.com/oddbit/flutter_facebook_app_events/issues/342 is fixed, that static framework's privacy manifest will be incorporated automatically into the build, but we don't currently know how that is handled by Xcode.

stuartmorgan commented 1 month ago

Is there a way to encourage ALL package developers to address them ASAP?

I would encourage anyone affected by a package's lack of privacy manifest support to reach out individually to the author of that package. We've done outreach where we are aware of it, but we don't have a way to find every potentially affected plugin. Apple has also done some outreach, but static frameworks prevent them from finding the source in an automated fashion.

stuartmorgan commented 1 month ago

@deepak-agendaboa What are the specific ITMS-91053 messages for your project?

deepak-agendaboa commented 1 month ago
ITMS-91053: Missing API declaration - Your app’s code in the “Agenda BOA” 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 “Agenda BOA” 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 “Agenda BOA” 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.

ITMS-91053: Missing API declaration - Your app’s code in the “Agenda BOA” file references one or more APIs that require reasons, including the following API categories: NSPrivacyAccessedAPICategoryUserDefaults. 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.
taufiq-husain commented 1 month ago

@stuartmorgan you're right! Great investigative work. It's definitely that package because we weren't using it before and never got the privacy manifest email before either.

As an aside note, does anyone else know of any other frequently updated Flutter package to track Facebook App Events? This package hasn't been updated in a while it seems so I doubt they'll do it. I don't know how else to track Facebook ads conversions on Flutter... 😭

stuartmorgan commented 1 month ago

@deepak-agendaboa The pubspec you provided has a number of version conflicts, and is not resolvable. We can't investigate further without a reproducible case—although we already know that facebook_app_events is at least one source of three of your four warnings. (I would encourage you to look into pubspec.lock, rather than pinning everything exactly in your pubspec.yaml.)

iamnabink commented 1 month ago

I am also facing same problem, waiting for convenient solution or closing of this issue

dreyescabrera commented 1 month ago

Hi there. I am working on a project that is really behind on dependencies, latest versions, and even the Flutter sdk version itself. We are on Flutter v3.7.9. We can't update the dependencies to the latest versions at all before updating Flutter. Is updating everything our only option?

These are the warnings I received:

ITMS-91053: Missing API declaration - Your app’s code in the “Runner” 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 “Runner” 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 “Runner” file references one or more APIs that require reasons, including the following API categories: NSPrivacyAccessedAPICategoryUserDefaults. 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 “Runner” 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.
stuartmorgan commented 1 month ago

@realDiegoR If you aren't using versions of your dependencies that support privacy manifests, you would need to audit them all yourself and make custom versions that include all the necessary privacy manifest declarations. That's out of the scope of what the documentation this issue tracks would cover.

nitinrgadhiya commented 1 month ago

I received a "Missing API declaration" warning email on my new release on the app store. I never received before this warning in an email. In the latest version app store build, I did custom coding for Google Analytics consent and made changes in the "Swift" file accordingly.

is that the reason? How I can fix this?

  1. NSPrivacyAccessedAPICategoryDiskSpace
  2. NSPrivacyAccessedAPICategorySystemBootTime
  3. NSPrivacyAccessedAPICategoryFileTimestamp
  4. NSPrivacyAccessedAPICategoryUserDefaults

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.

ziqq commented 1 month ago

idea fixed this issue: It's important to Add Target.

Not working for me...

image
Last email from Apple > ITMS-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Runner” file contains “FileTimestamp” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftObjectiveC.dylib” file contains “FileTimestamp” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftMetal.dylib” file contains “FileTimestamp” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftCoreFoundation.dylib” file contains “FileTimestamp” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftCoreAudio.dylib” file contains “FileTimestamp” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftDispatch.dylib” file contains “FileTimestamp” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftCore.dylib” file contains “FileTimestamp” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftCoreLocation.dylib” file contains “FileTimestamp” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftQuartzCore.dylib” file contains “FileTimestamp” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftCoreImage.dylib” file contains “FileTimestamp” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftUIKit.dylib” file contains “FileTimestamp” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftCoreMedia.dylib” file contains “FileTimestamp” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftCoreGraphics.dylib” file contains “FileTimestamp” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftDarwin.dylib” file contains “FileTimestamp” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftos.dylib” file contains “FileTimestamp” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftIntents.dylib” file contains “FileTimestamp” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftFoundation.dylib” file contains “FileTimestamp” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Runner” file contains “DiskSpace” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftObjectiveC.dylib” file contains “DiskSpace” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftMetal.dylib” file contains “DiskSpace” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftCoreFoundation.dylib” file contains “DiskSpace” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftCoreAudio.dylib” file contains “DiskSpace” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftDispatch.dylib” file contains “DiskSpace” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftCore.dylib” file contains “DiskSpace” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftCoreLocation.dylib” file contains “DiskSpace” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftQuartzCore.dylib” file contains “DiskSpace” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftCoreImage.dylib” file contains “DiskSpace” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftUIKit.dylib” file contains “DiskSpace” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftCoreMedia.dylib” file contains “DiskSpace” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftCoreGraphics.dylib” file contains “DiskSpace” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftDarwin.dylib” file contains “DiskSpace” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftos.dylib” file contains “DiskSpace” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftIntents.dylib” file contains “DiskSpace” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftFoundation.dylib” file contains “DiskSpace” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Runner” file contains “UserDefaults” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftObjectiveC.dylib” file contains “UserDefaults” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftMetal.dylib” file contains “UserDefaults” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftCoreFoundation.dylib” file contains “UserDefaults” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftCoreAudio.dylib” file contains “UserDefaults” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftDispatch.dylib” file contains “UserDefaults” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftCore.dylib” file contains “UserDefaults” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftCoreLocation.dylib” file contains “UserDefaults” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftQuartzCore.dylib” file contains “UserDefaults” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftCoreImage.dylib” file contains “UserDefaults” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftUIKit.dylib” file contains “UserDefaults” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftCoreMedia.dylib” file contains “UserDefaults” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftCoreGraphics.dylib” file contains “UserDefaults” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftDarwin.dylib” file contains “UserDefaults” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftos.dylib” file contains “UserDefaults” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftIntents.dylib” file contains “UserDefaults” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftFoundation.dylib” file contains “UserDefaults” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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-91054: Invalid API category declaration - The PrivacyInfo.xcprivacy for the “PlugIns/FlutterWidgetVisitExtension.appex/FlutterWidgetVisitExtension” file contains “UserDefaults” as the value for a NSPrivacyAccessedAPIType key, which is invalid. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, values for NSPrivacyAccessedAPIType keys in your app’s privacy manifest must be valid API categories. 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 “Runner” 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. > > ITMS-91053: Missing API declaration - Your app’s code in the “Runner” 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 “Runner” file references one or more APIs that require reasons, including the following API categories: NSPrivacyAccessedAPICategoryUserDefaults. 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 “PlugIns/FlutterWidgetVisitExtension.appex/FlutterWidgetVisitExtension” file references one or more APIs that require reasons, including the following API categories: NSPrivacyAccessedAPICategoryUserDefaults. 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
stuartmorgan commented 1 month ago

@ziqq You should report that list of errors to Apple, as it looks like a bug in the App Store checks. (E.g., it's flagging all of the declarations of Apple's own frameworks.)

jmagman commented 1 month ago

@ziqq

“PlugIns/FlutterWidgetVisitExtension.appex/FlutterWidgetVisitExtension” file contains “UserDefaults” as the value for a NSPrivacyAccessedAPIType key, which is invalid.

Ignoring the Swift runtime libraries, this looks like an extension you maybe added, and the manifest file itself you added has an invalid value. Please read the warnings carefully. The ones that are tricky to track down are the static plugins that may show up as "Your app’s code in the “Runner” file references".

stuartmorgan commented 1 month ago

Ignoring the Swift runtime libraries, this looks like an extension you maybe added, and the manifest file itself you added has an invalid value.

Not necessarily, since the same warning is showing up for Swift runtime libraries. E.g.,

The PrivacyInfo.xcprivacy for the “Frameworks/libswiftDarwin.dylib” file contains “UserDefaults” as the value for a NSPrivacyAccessedAPIType key, which is invalid.

Unless those strings are literally what's in the privacy manifests (in which case something post-processed that app and stripped the NSPrivacyAccessedAPICategory prefix from every value in the entire bundle, rendering everything invalid), the check was just flagging everything as invalid.

andcea commented 1 month ago

I got the same email from apple for NSPrivacyAccessedAPICategoryFileTimestamp NSPrivacyAccessedAPICategoryDiskSpace NSPrivacyAccessedAPICategorySystemBootTime NSPrivacyAccessedAPICategoryUserDefaults

Any way to check what dependencies are causing these? Possibly something like datadog_flutter_plugin. I couldn't find anything in the build logs.

stuartmorgan commented 1 month ago

Any way to check what dependencies are causing these?

Assuming the warnings list "Runner" as the problem (if not it should be easy, since whatever the name of the framework it lists is the problem in that case), this issue tracks creating documentation for doing that. In the meantime this comment is essentially an early, minimal version of some of what those docs will say.

What's described there will only work if your dependencies all have any necessary privacy manifests. Finding issues caused by statically linked dependencies that are missing required privacy manifests is much harder, and we don't have docs for that yet. It's something we'll be working on very soon. (For those with a fair amount of iOS development experience: you need to audit the source of all source dependencies, and the binaries—using nm—of all pre-built dependencies, for each Required Reason API in the flagged categories.)

taufiq-husain commented 1 month ago

Hey @stuartmorgan I removed the facebook app events package and resubmitted to AppStore today. I am still getting this error:

ITMS-91053: Missing API declaration - Your app’s code in the “Runner” 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.

Note that my packages for the same are now just these (everything the same with facebook_app_events removed):

pubspec.yaml ``` dependencies: animated_emoji: ^3.1.0 animated_text_kit: ^4.2.2 audio_session: ^0.1.18 auto_size_text: ^3.0.0 cached_network_image: ^3.3.1 cloud_firestore: ^4.15.10 cloud_functions: ^4.6.10 crypto: ^3.0.3 firebase_analytics: ^10.9.0 firebase_auth: ^4.18.0 firebase_core: ^2.27.2 firebase_crashlytics: ^3.4.20 firebase_storage: ^11.6.11 flutter: sdk: flutter flutter_branch_sdk: ^7.1.0 flutter_easyloading: ^3.0.5 flutter_local_notifications: ^17.0.0 flutter_native_splash: ^2.4.0 get: ^4.6.6 google_fonts: ^6.2.1 google_sign_in: ^6.2.1 http: ^1.2.1 image_cropper: ^5.0.1 image_picker: ^1.0.7 in_app_review: ^2.0.9 intl: ^0.19.0 just_audio: ^0.9.36 mutex: ^3.1.0 path_provider: ^2.1.2 permission_handler: ^11.3.0 purchases_flutter: ^6.24.0 record: ^5.0.5 share_plus: ^8.0.2 shared_preferences: ^2.2.2 simple_ripple_animation: ^0.0.9 timezone: ^0.9.2 toastification: ^1.2.1 url_launcher: ^6.2.5 video_player: ^2.8.3 wakelock_plus: ^1.1.4 dev_dependencies: flutter_lints: ^3.0.0 # flutter_native_splash: ^2.3.13 # dependency_validator: ^3.0.0 # flutter_app_name: ^0.1.0 # flutter_launcher_icons: ^0.13.1 # flutter_test: # sdk: flutter ```
Satishpethani92 commented 1 month ago

Steps:

  1. Create PrivacyInfo.xcprivacy File.

    Xcode Menu: File -> File (Create New File with App Privacy Template) image Click on Next And select your Runner Workspace.

  2. Add privacy Configuration in PrivacyInfo.xcprivacy

    Example for Privacy Nutrition Label Types:

    1. Privacy Accessed API Type Privacy Nutrition Label Types For Location like If your Application using Precise Location,
    2. select Collected Data Type : Precise Location
    3. Linked to User : YES/ NO
    4. Used for Tracking : YES/NO
    5. Add Collection Purposes for Application

    Example for Privacy Accessed API Types:

    1. Add Privacy Accessed API Types For Disk Space If your Application using application directory or file storage to store file,
    2. Privacy Accessed API Type : Disk Space
    3. Add Privacy Accessed API Reasons (Add Reason For Use)

PrivacyInfo.xcprivacy

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>NSPrivacyCollectedDataTypes</key>
    <array>
        <dict>
            <key>NSPrivacyCollectedDataType</key>
            <string>NSPrivacyCollectedDataTypePreciseLocation</string>
            <key>NSPrivacyCollectedDataTypeLinked</key>
            <true/>
            <key>NSPrivacyCollectedDataTypeTracking</key>
            <false/>
            <key>NSPrivacyCollectedDataTypePurposes</key>
            <array>
                <string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
                <string>NSPrivacyCollectedDataTypePurposeProductPersonalization</string>
            </array>
        </dict>
    </array>
    <key>NSPrivacyAccessedAPITypes</key>
    <array>
        <dict>
            <key>NSPrivacyAccessedAPIType</key>
            <string>NSPrivacyAccessedAPICategoryDiskSpace</string>
            <key>NSPrivacyAccessedAPITypeReasons</key>
            <array>
                <string>54BD.1</string>
            </array>
        </dict>
    </array>
</dict>
</plist>

For More Information : https://developer.apple.com/videos/play/wwdc2023/10060 It's work's for me you can try it and let me know

stuartmorgan commented 1 month ago

@taufiq-husain What do the following two commands print when run in your project directory?

nm build/ios/Release-iphoneos/Runner.app/Runner | grep mach_absolute_time
nm build/ios/Release-iphoneos/Runner.app/Runner | grep systemUptime

If I make a new project and add that dependency list, I don't get any hits for either of those commands, so it doesn't look like I can reproduce it. Several dependencies in that list do use mach_absolute_time, but they should build as frameworks.

taufiq-husain commented 1 month ago

@taufiq-husain What do the following two commands print when run in your project directory?

nm build/ios/Release-iphoneos/Runner.app/Runner | grep mach_absolute_time
nm build/ios/Release-iphoneos/Runner.app/Runner | grep systemUptime

If I make a new project and add that dependency list, I don't get any hits for either of those commands, so it doesn't look like I can reproduce it. Several dependencies in that list do use mach_absolute_time, but they should build as frameworks.

I tried it at first but it was saying files don't exist. I did flutter run --release on a real device then tried your commands again and this time no error nor anything was printed. Does this mean the issue was resolved for next time? How come I got the email from Apple then?

Perhaps something was lingering from past builds? I don't know because I did flutter clean; flutter pub get; flutter build ipa --release then used Transporter to upload the app build to App Store.

stuartmorgan commented 1 month ago

Sorry, I apparently read the category from the wrong comment there; the commands for NSPrivacyAccessedAPICategoryFileTimestamp would be:

nm build/ios/Release-iphoneos/Runner.app/Runner | grep NSFileCreationDate
nm build/ios/Release-iphoneos/Runner.app/Runner | grep NSFileModificationDate
nm build/ios/Release-iphoneos/Runner.app/Runner | grep fileModificationDate
nm build/ios/Release-iphoneos/Runner.app/Runner | grep NSURLContentModificationDateKey
nm build/ios/Release-iphoneos/Runner.app/Runner | grep NSURLCreationDateKey
nm build/ios/Release-iphoneos/Runner.app/Runner | grep getattrlist
nm build/ios/Release-iphoneos/Runner.app/Runner | grep fstatat
nm build/ios/Release-iphoneos/Runner.app/Runner | grep "stat$"

Those also don't hit for me when I build locally with your dependency list though.

Does this mean the issue was resolved for next time?

I do not know how Apple's enforcement of Required Reason APIs works, so I can't say what will happen next time. If you upload an app to Apple where the Runner binary you upload does not have hits for those symbols, but you still get an ITMS-91053 warning for NSPrivacyAccessedAPICategoryFileTimestamp on the Runner file, that would mean that I do not currently know how to reliably detect these cases locally.

How come I got the email from Apple then?

Only Apple can definitively answer questions about why they flag applications. We'll continue to work on creating documentation for the cases we can, but you could also reach out to Apple to let them know that you do not know why your application is being flagged and request guidance.

taufiq-husain commented 1 month ago
nm build/ios/Release-iphoneos/Runner.app/Runner | grep NSFileCreationDate
nm build/ios/Release-iphoneos/Runner.app/Runner | grep NSFileModificationDate
nm build/ios/Release-iphoneos/Runner.app/Runner | grep fileModificationDate
nm build/ios/Release-iphoneos/Runner.app/Runner | grep NSURLContentModificationDateKey
nm build/ios/Release-iphoneos/Runner.app/Runner | grep NSURLCreationDateKey
nm build/ios/Release-iphoneos/Runner.app/Runner | grep getattrlist
nm build/ios/Release-iphoneos/Runner.app/Runner | grep fstatat
nm build/ios/Release-iphoneos/Runner.app/Runner | grep "stat$"

I ran all of these and empty results showed up for me too.

I do not know how Apple's enforcement of Required Reason APIs works, so I can't say what will happen next time. If you upload an app to Apple where the Runner binary you upload does not have hits for those symbols, but you still get an ITMS-91053 warning for NSPrivacyAccessedAPICategoryFileTimestamp on the Runner file, that would mean that I do not currently know how to reliably detect these cases locally.

Hmm. I don't know what's going on then with Apple.

Only Apple can definitively answer questions about why they flag applications. We'll continue to work on creating documentation for the cases we can, but you could also reach out to Apple to let them know that you do not know why your application is being flagged and request guidance.

If I ask apple developer support about it, what should I say specifically? I'm worried I won't be able to update my app after May 1st...

stuartmorgan commented 1 month ago

If I ask apple developer support about it, what should I say specifically?

That would be up to you to decide; we don't have any more information than you do here, so we can't offer specific advice.

I'm worried I won't be able to update my app after May 1st

I definitely understand, but ultimately there's only so much the Flutter team can do here:

We're working on doing what we can to gather information and document findings and suggestions, but since this set of issues isn't inherently specific to Flutter (any app with third-party dependencies can have this problem, and there are non-Flutter-developers making scripts/tools to try to find Required Reason APIs in third-party dependencies), we are operating from the same set of information as everyone else.

taufiq-husain commented 1 month ago

That would be up to you to decide; we don't have any more information than you do here, so we can't offer specific advice.

Many thanks to you and the whole Flutter team for everything. Y'all are very helpful!

I definitely understand, but ultimately there's only so much the Flutter team can do here:

I sent Apple developer support a message with some details now. Hopefully, they can help with it. I will update here if I find a plausible solution.

stuartmorgan commented 1 month ago

Friendly reminder to read https://github.com/flutter/flutter/issues/145269#issuecomment-2007016285 before posting here.

thomas-stockx commented 1 month ago

Maybe a good starting point for the lack of documentation from the Flutter team, would be the documentation provided by Unity (another framework on Apple's list of affected SDKs):

https://forum.unity.com/threads/apple-privacy-manifest-updates-for-unity-engine.1529026/