codenameone / CodenameOne

Cross-platform framework for building truly native mobile apps with Java or Kotlin. Write Once Run Anywhere support for iOS, Android, Desktop & Web.
https://www.codenameone.com/
Other
1.65k stars 395 forks source link

New requirement in Apple this 1 May 2024 it's need to update your source code this requirement #3800

Open DurankGts opened 1 month ago

DurankGts commented 1 month ago

https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api?language=objc

please check this..

Hello, We noticed one or more issues with a recent submission for TestFlight review for the following app: • xxxxxxxx • Version 3.97 • Build 294 Although submission for TestFlight review was successful, you may want to correct the following issues in your next submission for TestFlight 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 “Appxxxx” 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

shai-almog commented 1 month ago

This seems to be unresolved according to this.

We need to remove usage of:

shai-almog commented 1 month ago

@DurankGts I committed a fix for the NSPrivacyAccessedAPICategoryUserDefaults issue but can't find usage of NSPrivacyAccessedAPICategorySystemBootTime which means usage of the mach_absolute_time() or systemUptime APIs. I can't find any use of them in the project. I'm assuming they are used by one of the cn1libs you depend on. Which cn1libs do you use?

Rocketeer007 commented 1 month ago

@shai-almog I can't speak for other users experiencing this issue... but for me, the libzbar.a binary appears to be making use of mach_absolute_time(); this dependency is introduced by https://github.com/codenameone/QRScanner

I suspect that since this is a binary dependency in that project, we won't be able to modify it easily... so perhaps you could document for us the best way to add entries to NSPrivacyAccessedAPITypes in the privacy manifest?

shai-almog commented 1 month ago

@shannah this seems to be related to debugging code here. Probably need to recompile zbar to remove that.

DurankGts commented 1 month ago

@DurankGts I committed a fix for the NSPrivacyAccessedAPICategoryUserDefaults issue but can't find usage of NSPrivacyAccessedAPICategorySystemBootTime which means usage of the mach_absolute_time() or systemUptime APIs. I can't find any use of them in the project. I'm assuming they are used by one of the cn1libs you depend on. Which cn1libs do you use?

this my libs BouncyCastleCN1Lib CN1DataAccess CN1JSON CN1Sensors Connectivity Telephony googlemaps-1.1.2-SNAPSHOT

DurankGts commented 3 weeks ago

hi, any progress about this issue...

DurankGts commented 3 weeks ago

this the warning today, please help me about this issue. I Need to submitt a new app to App Store.

Hello, We noticed one or more issues with a recent submission for TestFlight review for the following app: • appName • Version 3.97 • Build 295 Although submission for TestFlight review was successful, you may want to correct the following issues in your next submission for TestFlight 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 “xxxx” 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 “xxxx” 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 “xxxx” 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 “xxxx” 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

Contact Us | App Store Connect | One Apple Park Way, Cupertino, CA 95014

Privacy Policy | Terms of Service

Contact Us | App Store Connect One Apple Park Way, Cupertino, CA 95014

Privacy Policy | Terms of Service

DurankGts commented 3 weeks ago

this the ios lib too, that is inserted in my codenameone_settings.properties

codename1.arg.ios.add_libs=CoreTelephony.framework;SystemConfiguration.framework;libc++.dylib;libicucore.dylib;libz.dylib;CoreData.framework;CoreText.framework;GLKit.framework;ImageIO.framework;AVKit.framework

I don't now the use of this or if your automatic build insert in my properties file.

any lib is related with this warning???

shai-almog commented 3 weeks ago

There are many libraries here so this is a bit hard to pinpoint:

The following all include native code:

I'm guessing it's the first 3 that are a problem. I think the solution would be to add the privacy file to the generated xcode project and provide build hints to indicate why you need that access.

ruifarinhalves commented 3 weeks ago

Good afternoon,

I'm still having the same problem.

I had already sent it to reddit (cn1) https://www.reddit.com/r/cn1/comments/1bwiuss/submitting_app_to_apple_store/

I only use the Connectivity and QRScanner libraries in the app. Can you help? Thanks. Rui Alves

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 “Appname” 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 “Appname” 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.

shai-almog commented 2 weeks ago

I just added build hints to help resolve this issue. Notice that this is a separate thing from the work we're doing on fixing the cn1libs but that would take some time as cn1lib often include native code outside of our control. Notice that this feature isn't tested and will only be available in the Friday update to the build servers.

Clean Codename One should no longer include code that requires extra privacy permissions by default. Although I might need to add some of that code back for features in the FileSystemStorage.

If you use a cn1lib and get these errors from Apple you can fix them individually using build hints with this format: ios.privacy.NSPrivacyName=PrivacyReason

E.g. looking at this error:

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

We would need to add the build hint:

ios.privacy.NSPrivacyAccessedAPICategoryDiskSpace=E174.1

The value on the left is obviously the privacy violation. The value on the right side is the reason ID. You can find those here. Just search for the problem, in my case I searched for "Disk space" and found the list of reasons a bit below. I picked the second one which is described as such by Apple:

E174.1

Declare this reason to check whether there is sufficient disk space to write files, or to check whether the disk space is low so that the app can delete files when the disk space is low. The app must behave differently based on disk space in a way that is observable to users.

Information accessed for this reason, or any derived information, may not be sent off-device. There is an exception that allows the app to avoid downloading files from a server when disk space is insufficient.

DurankGts commented 2 weeks ago

@shannah can I insert this String in your solutions to translate privacy reason??? image

DurankGts commented 2 weeks ago

"CFBundleDisplayName"="xxxxxxxxxxxxxxxxx"; "NSCameraUsageDescription"="xxxxxxxxxxxxxxxxxxxx"; "NSContactsUsageDescription"="xxxxxxxxxxxxxxxxxxxxxxxx"; "NSMicrophoneUsageDescription"="xxxxxxxxxxxxxxxxxxxxxxxxxx"; "NSLocationWhenInUseUsageDescription"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx."; "NSLocationAlwaysUsageDescription"="xxxxxxxxxxxxxxxxxxxxx"; "NSPhotoLibraryUsageDescription"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; "NSPrivacyAccessedAPICategoryDiskSpace"= "??????????" ....

DurankGts commented 2 weeks ago

or just it's necesary to specify image

ruifarinhalves commented 1 week ago

Good morning,

I added the following build hint:

codename1.arg.ios.privacy.NSPrivacyAccessedAPICategorySystemBootTime=35F9.1 codename1.arg.ios.privacy.NSPrivacyAccessedAPICategoryUserDefaults=CA92.1

But it was not accepted on App Store Connect, as I received the following error message:

Please correct the following issues and upload a new binary to App Store Connect.

ITMS-91056: Invalid privacy manifest - The PrivacyInfo.xcprivacy file from the following path is invalid: “PrivacyInfo.xcprivacy”. Keys and values in any privacy manifest must be in a valid format. For more details about privacy manifest files, visit: https://developer.apple.com/documentation/bundleresources/privacy_manifest_files.

What can I change? Is the Hint build poorly written? Thanks.

DurankGts commented 1 week ago

in my case until cn1 fix this issue I remove this ios libs and this warning don't appear

codename1.arg.ios.add_libs=CoreTelephony.framework;libc++.dylib;libicucore.dylib;libz.dylib;CoreData.framework;CoreText.framework;GLKit.framework;ImageIO.framework;AVKit.framework

shai-almog commented 5 days ago

I just committed a fix for the malformed privacy manifest issue which should hopefully solve the problem. I'll push it to the servers later today since this is a blocking issue for many developers.

shai-almog commented 4 days ago

This fix is pushed now and should be a part of builds.