From 2a5362e85f594a16a3bfcc31cd0561965a8a6e04 Mon Sep 17 00:00:00 2001 From: Shai Almog <67850168+shai-almog@users.noreply.github.com> Date: Wed, 17 Apr 2024 10:11:18 +0300 Subject: [PATCH] Work for iOS privacy requirements Regarding NSPrivacyAccessedAPICategoryUserDefaults. This should address part of the problem in #3800 but doesn't fully fix it. --- Ports/iOSPort/nativeSources/IOSNative.m | 2 ++ Ports/iOSPort/nativeSources/permission_apis.h | 1 + 2 files changed, 3 insertions(+) diff --git a/Ports/iOSPort/nativeSources/IOSNative.m b/Ports/iOSPort/nativeSources/IOSNative.m index b6cd5214d8..a7f0998678 100644 --- a/Ports/iOSPort/nativeSources/IOSNative.m +++ b/Ports/iOSPort/nativeSources/IOSNative.m @@ -2535,6 +2535,7 @@ void com_codename1_impl_ios_IOSNative_setBrowserPage___long_java_lang_String_jav } void com_codename1_impl_ios_IOSNative_setBrowserUserAgent___long_java_lang_String(CN1_THREAD_STATE_MULTI_ARG JAVA_OBJECT instanceObject, JAVA_LONG peer, JAVA_OBJECT ua) { +#ifdef ENABLE_SET_BROWSER_USER_AGENT NSString *_ua = toNSString(CN1_THREAD_GET_STATE_PASS_ARG ua); dispatch_async(dispatch_get_main_queue(), ^{ POOL_BEGIN(); @@ -2543,6 +2544,7 @@ void com_codename1_impl_ios_IOSNative_setBrowserUserAgent___long_java_lang_Strin [[NSUserDefaults standardUserDefaults] registerDefaults:dictionary]; POOL_END(); }); +#endif } diff --git a/Ports/iOSPort/nativeSources/permission_apis.h b/Ports/iOSPort/nativeSources/permission_apis.h index 86150f8b9c..72999f16af 100644 --- a/Ports/iOSPort/nativeSources/permission_apis.h +++ b/Ports/iOSPort/nativeSources/permission_apis.h @@ -2,5 +2,6 @@ #define PERMISSION_APIS__HH //#define checkModificationDatePermission +//#define ENABLE_SET_BROWSER_USER_AGENT #endif // PERMISSION_APIS__HH \ No newline at end of file