From 618f9dba315b4d5a701914502106314880563876 Mon Sep 17 00:00:00 2001 From: justSmK <28645140+justSmK@users.noreply.github.com> Date: Fri, 11 Oct 2024 12:23:34 +0300 Subject: [PATCH 01/14] MBX-0000: Fix MBLogger `writeToCD` func Fix No calls to throwing functions occur within 'try' expression --- MindboxLogger/Shared/MBLogger.swift | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/MindboxLogger/Shared/MBLogger.swift b/MindboxLogger/Shared/MBLogger.swift index fa1c9e75..73cdd510 100644 --- a/MindboxLogger/Shared/MBLogger.swift +++ b/MindboxLogger/Shared/MBLogger.swift @@ -116,10 +116,6 @@ private extension MBLogger { } private func writeToCD(message: String, timestamp: Date = Date()) { - do { - try MBLoggerCoreDataManager.shared.create(message: message, timestamp: timestamp) - } catch { - - } + MBLoggerCoreDataManager.shared.create(message: message, timestamp: timestamp) } } From 7f53636ed082c405a215fafcb735774f19b8397c Mon Sep 17 00:00:00 2001 From: justSmK <28645140+justSmK@users.noreply.github.com> Date: Fri, 11 Oct 2024 12:25:06 +0300 Subject: [PATCH 02/14] MBX-0000: Fix `@unchecked Sendable` Class must restate inherited '@unchecked Sendable' conformance --- Mindbox/GuaranteedDeliveryManager/DeliveryOperation.swift | 2 +- .../GuaranteedDeliveryManager/GuaranteedDeliveryManager.swift | 2 +- .../Shared/LoggerRepository/MBPersistentContainer.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Mindbox/GuaranteedDeliveryManager/DeliveryOperation.swift b/Mindbox/GuaranteedDeliveryManager/DeliveryOperation.swift index 6570f002..299c8763 100644 --- a/Mindbox/GuaranteedDeliveryManager/DeliveryOperation.swift +++ b/Mindbox/GuaranteedDeliveryManager/DeliveryOperation.swift @@ -9,7 +9,7 @@ import Foundation import MindboxLogger -class DeliveryOperation: AsyncOperation { +class DeliveryOperation: AsyncOperation, @unchecked Sendable { private let event: Event private let databaseRepository: MBDatabaseRepository diff --git a/Mindbox/GuaranteedDeliveryManager/GuaranteedDeliveryManager.swift b/Mindbox/GuaranteedDeliveryManager/GuaranteedDeliveryManager.swift index a9afff17..dd6c05f7 100644 --- a/Mindbox/GuaranteedDeliveryManager/GuaranteedDeliveryManager.swift +++ b/Mindbox/GuaranteedDeliveryManager/GuaranteedDeliveryManager.swift @@ -143,7 +143,7 @@ final class GuaranteedDeliveryManager: NSObject { } -class AsyncOperation: Operation { +class AsyncOperation: Operation, @unchecked Sendable { private let lockQueue = DispatchQueue(label: "com.mindbox.asyncoperation", attributes: .concurrent) override var isAsynchronous: Bool { diff --git a/MindboxLogger/Shared/LoggerRepository/MBPersistentContainer.swift b/MindboxLogger/Shared/LoggerRepository/MBPersistentContainer.swift index 01769524..98dec6c3 100644 --- a/MindboxLogger/Shared/LoggerRepository/MBPersistentContainer.swift +++ b/MindboxLogger/Shared/LoggerRepository/MBPersistentContainer.swift @@ -9,7 +9,7 @@ import Foundation import CoreData -public class MBPersistentContainer: NSPersistentContainer { +public class MBPersistentContainer: NSPersistentContainer, @unchecked Sendable { public static var applicationGroupIdentifier: String? = nil From 1a3e5cb13f1fe1ae6d67cc9542d4a40d12d09f45 Mon Sep 17 00:00:00 2001 From: justSmK <28645140+justSmK@users.noreply.github.com> Date: Fri, 11 Oct 2024 12:26:06 +0300 Subject: [PATCH 03/14] MBX-0000: Fix `Immutable value was never used; consider replacing with '_' or removing it` --- .../NotificationFormatStrategy.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mindbox/PushNotifications/PushNotificationFormatStrategies/NotificationFormatStrategy.swift b/Mindbox/PushNotifications/PushNotificationFormatStrategies/NotificationFormatStrategy.swift index 56a2ec22..c5681c65 100644 --- a/Mindbox/PushNotifications/PushNotificationFormatStrategies/NotificationFormatStrategy.swift +++ b/Mindbox/PushNotifications/PushNotificationFormatStrategies/NotificationFormatStrategy.swift @@ -57,9 +57,9 @@ class CurrentFormatStrategy: NotificationFormatStrategy { func handle(userInfo: [AnyHashable : Any]) -> MBPushNotification? { guard let data = try? JSONSerialization.data(withJSONObject: userInfo), let notificationModel = try? JSONDecoder().decode(MBPushNotification.self, from: data), - let clickUrl = notificationModel.clickUrl, + notificationModel.clickUrl != nil, let alert = notificationModel.aps?.alert, - let body = alert.body else { + alert.body != nil else { Logger.common(message: "CurrentFormatStrategy: Failed to parse current notification format. userInfo: \(userInfo)", level: .error, category: .notification) return nil } From c106a32d24018984e6e7b3e5a61cc42ab03d0e01 Mon Sep 17 00:00:00 2001 From: justSmK <28645140+justSmK@users.noreply.github.com> Date: Fri, 11 Oct 2024 12:40:27 +0300 Subject: [PATCH 04/14] MBX-0000: Suppress `deprecated` shownInAppsIds warning --- .../ImplementationOfMigrations/ShownInAppsIdsMigration.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Mindbox/Utilities/Migrations/ImplementationOfMigrations/ShownInAppsIdsMigration.swift b/Mindbox/Utilities/Migrations/ImplementationOfMigrations/ShownInAppsIdsMigration.swift index 78435e6d..39839072 100644 --- a/Mindbox/Utilities/Migrations/ImplementationOfMigrations/ShownInAppsIdsMigration.swift +++ b/Mindbox/Utilities/Migrations/ImplementationOfMigrations/ShownInAppsIdsMigration.swift @@ -16,6 +16,7 @@ final class MigrationShownInAppsIds: MigrationProtocol { "Migration shownInAppsIds to shownInappsDictionary. Starting with SDK 2.10.0." } + @available(*, deprecated, message: "Suppress `deprecated` shownInAppsIds warning") var isNeeded: Bool { persistenceStorage.shownInAppsIds?.isEmpty == false } @@ -24,6 +25,7 @@ final class MigrationShownInAppsIds: MigrationProtocol { 0 } + @available(*, deprecated, message: "Suppress deprecated `shownInAppsIds` warning") func run() throws { guard let oldShownInAppsIds = persistenceStorage.shownInAppsIds else { return From b27c267c498c47746e18fc7a9d30c5c729728365 Mon Sep 17 00:00:00 2001 From: justSmK <28645140+justSmK@users.noreply.github.com> Date: Fri, 11 Oct 2024 12:43:43 +0300 Subject: [PATCH 05/14] MBX-0000: Increment Build Number Script` for install builds only Run script build phase 'Increment Build Number Script' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. --- Mindbox.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mindbox.xcodeproj/project.pbxproj b/Mindbox.xcodeproj/project.pbxproj index 5cf324c2..dd5a9114 100644 --- a/Mindbox.xcodeproj/project.pbxproj +++ b/Mindbox.xcodeproj/project.pbxproj @@ -3482,7 +3482,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3159FFB425B5AAF300EE80E9 /* Increment Build Number Script */ = { isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; + buildActionMask = 8; files = ( ); inputFileListPaths = ( @@ -3494,7 +3494,7 @@ ); outputPaths = ( ); - runOnlyForDeploymentPostprocessing = 0; + runOnlyForDeploymentPostprocessing = 1; shellPath = /bin/sh; shellScript = "buildNumber=$(/usr/libexec/PlistBuddy -c \"Print CFBundleVersion\" \"${PROJECT_DIR}/${INFOPLIST_FILE}\")\nbuildNumber=$(($buildNumber + 1))\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $buildNumber\" \"${PROJECT_DIR}/${INFOPLIST_FILE}\"\n"; }; From 03af6d910f05840ffbdd36d3e17f5faceb1bf16e Mon Sep 17 00:00:00 2001 From: justSmK <28645140+justSmK@users.noreply.github.com> Date: Fri, 11 Oct 2024 12:48:18 +0300 Subject: [PATCH 06/14] MBX-0000: Fix `SegmentationCheckResponse` duplication Skipping duplicate build file in Compile Sources build phase: /Users/semko/dev/iOS/ios-sdk/Mindbox/InAppMessages/Models/CustomerSegment/SegmentationCheckResponse.swift --- Mindbox.xcodeproj/project.pbxproj | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Mindbox.xcodeproj/project.pbxproj b/Mindbox.xcodeproj/project.pbxproj index dd5a9114..a2302400 100644 --- a/Mindbox.xcodeproj/project.pbxproj +++ b/Mindbox.xcodeproj/project.pbxproj @@ -164,6 +164,7 @@ 47BD5BFB2C578BC600F965C0 /* MigrationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47BD5BFA2C578BC600F965C0 /* MigrationManager.swift */; }; 47BD5BFE2C578FB400F965C0 /* BaseMigration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47BD5BFD2C578FB400F965C0 /* BaseMigration.swift */; }; 47D63E2B2C2EABDF0055E7D8 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = F3EC93BA2AF105DA0030D107 /* PrivacyInfo.xcprivacy */; }; + 47EFBB2F2CB92B240023A4B9 /* SegmentationCheckResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B4F9DEE28D08897002C9CF0 /* SegmentationCheckResponse.swift */; }; 47FDF0BA2C5BDAB80051F08C /* MigrationManagerProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47FDF0B92C5BDAB80051F08C /* MigrationManagerProtocol.swift */; }; 47FDF0BC2C5BE8BB0051F08C /* MigrationProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47FDF0BB2C5BE8BB0051F08C /* MigrationProtocol.swift */; }; 6F1EAA16266A670E007A335B /* ProductListItemsResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F1EAA15266A670E007A335B /* ProductListItemsResponse.swift */; }; @@ -253,7 +254,6 @@ 9B24FABD28C757A700F10B5D /* InAppResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B24FABC28C757A700F10B5D /* InAppResponse.swift */; }; 9B2F5F752902975B00F28A96 /* InAppMessagesTracker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B2F5F742902975B00F28A96 /* InAppMessagesTracker.swift */; }; 9B33F3CD28D0986900A3FFF9 /* CustomerSegmentsAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B33F3CC28D0986900A3FFF9 /* CustomerSegmentsAPI.swift */; }; - 9B4F9DEF28D08897002C9CF0 /* SegmentationCheckResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B4F9DEE28D08897002C9CF0 /* SegmentationCheckResponse.swift */; }; 9B4F9DF228D088A0002C9CF0 /* InAppsCheckRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B4F9DF028D088A0002C9CF0 /* InAppsCheckRequest.swift */; }; 9B4F9DF328D088A0002C9CF0 /* InAppFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B4F9DF128D088A0002C9CF0 /* InAppFormData.swift */; }; 9B4F9DF828D088A9002C9CF0 /* InAppConfigutationMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B4F9DF528D088A8002C9CF0 /* InAppConfigutationMapper.swift */; }; @@ -3505,6 +3505,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 47EFBB2F2CB92B240023A4B9 /* SegmentationCheckResponse.swift in Sources */, F331DD062A83A56500222120 /* ModalViewController.swift in Sources */, F331DCC12A80993600222120 /* ContentElement.swift in Sources */, 847F581725C8981F00147A9A /* HTTPURLResponseStatusCodeValidator.swift in Sources */, @@ -3741,8 +3742,6 @@ F33608122A8A151C00C7C9B7 /* ContentPosition.swift in Sources */, 337A474026553938000DC613 /* Sex.swift in Sources */, F3A8B9922A3A408C00E9C055 /* SDKVersionValidator.swift in Sources */, - 9B4F9DEF28D08897002C9CF0 /* SegmentationCheckResponse.swift in Sources */, - 9B4F9DEF28D08897002C9CF0 /* SegmentationCheckResponse.swift in Sources */, F31A94782BC6995500E6C978 /* InappFrequency.swift in Sources */, F3482F212A65DC2C002A41EC /* URLInappMessageDelegate.swift in Sources */, BB6563102BE3BA430090C473 /* UIApplication+Extensions.swift in Sources */, From 6d88b6ddce481080ddbd3fba246a82906d93e197 Mon Sep 17 00:00:00 2001 From: justSmK <28645140+justSmK@users.noreply.github.com> Date: Fri, 11 Oct 2024 13:22:40 +0300 Subject: [PATCH 07/14] MBX-0000: Fix NotificationsService `Immutable value was never used; consider replacing with '_' or removing it` --- .../NotificationFormatStrategy.swift | 4 ++-- MindboxNotifications/PushNotifications/PushValidator.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MindboxNotifications/PushNotifications/PushNotificationFormatStrategies/NotificationFormatStrategy.swift b/MindboxNotifications/PushNotifications/PushNotificationFormatStrategies/NotificationFormatStrategy.swift index 6cc94955..04ad29ea 100644 --- a/MindboxNotifications/PushNotifications/PushNotificationFormatStrategies/NotificationFormatStrategy.swift +++ b/MindboxNotifications/PushNotifications/PushNotificationFormatStrategies/NotificationFormatStrategy.swift @@ -57,9 +57,9 @@ final class CurrentFormatStrategy: NotificationFormatStrategy { func handle(userInfo: [AnyHashable : Any]) -> MBPushNotification? { guard let data = try? JSONSerialization.data(withJSONObject: userInfo), let notificationModel = try? JSONDecoder().decode(MBPushNotification.self, from: data), - let clickUrl = notificationModel.clickUrl, + notificationModel.clickUrl != nil, let alert = notificationModel.aps?.alert, - let body = alert.body else { + alert.body != nil else { Logger.common(message: "CurrentFormatStrategy: Failed to parse current notification format. userInfo: \(userInfo)", level: .error, category: .notification) return nil } diff --git a/MindboxNotifications/PushNotifications/PushValidator.swift b/MindboxNotifications/PushNotifications/PushValidator.swift index f517efc7..2f42d93d 100644 --- a/MindboxNotifications/PushNotifications/PushValidator.swift +++ b/MindboxNotifications/PushNotifications/PushValidator.swift @@ -15,7 +15,7 @@ protocol PushValidator { final class MindboxPushValidator: PushValidator { func isValid(item: [AnyHashable : Any]) -> Bool { - guard let pushModel = NotificationFormatter.formatNotification(item) else { + guard NotificationFormatter.formatNotification(item) != nil else { Logger.common(message: "MindboxPushValidator: Failed to convert item to Mindbox push model. Validation failed.", level: .error, category: .notification) return false } From 1e916d1efc09080ed162ddef09507d8e6582d45d Mon Sep 17 00:00:00 2001 From: justSmK <28645140+justSmK@users.noreply.github.com> Date: Fri, 11 Oct 2024 13:23:34 +0300 Subject: [PATCH 08/14] MBX-0000: Perform Changes - Xcode recommendations --- Mindbox.xcodeproj/project.pbxproj | 47 +++++++++++++++---- .../xcshareddata/xcschemes/Mindbox.xcscheme | 2 +- .../xcschemes/MindboxLogger.xcscheme | 2 +- .../xcschemes/MindboxNotifications.xcscheme | 2 +- 4 files changed, 40 insertions(+), 13 deletions(-) diff --git a/Mindbox.xcodeproj/project.pbxproj b/Mindbox.xcodeproj/project.pbxproj index a2302400..f476e53d 100644 --- a/Mindbox.xcodeproj/project.pbxproj +++ b/Mindbox.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -3273,8 +3273,9 @@ 313B232725ADEA0F00A1CB72 /* Project object */ = { isa = PBXProject; attributes = { + BuildIndependentTargetsInParallel = YES; LastSwiftUpdateCheck = 1410; - LastUpgradeCheck = 1250; + LastUpgradeCheck = 1600; ORGANIZATIONNAME = Mindbox; TargetAttributes = { 313B232F25ADEA0F00A1CB72 = { @@ -4038,6 +4039,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -4061,7 +4063,7 @@ SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TVOS_DEPLOYMENT_TARGET = 10.0; + TVOS_DEPLOYMENT_TARGET = 12.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; WATCHOS_DEPLOYMENT_TARGET = 6.0; @@ -4107,6 +4109,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -4123,7 +4126,7 @@ SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; - TVOS_DEPLOYMENT_TARGET = 10.0; + TVOS_DEPLOYMENT_TARGET = 12.0; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -4135,12 +4138,14 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 2; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; INFOPLIST_FILE = Mindbox/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( @@ -4148,7 +4153,9 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); + MACOSX_DEPLOYMENT_TARGET = 11.0; MARKETING_VERSION = 2.7.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14"; PRODUCT_BUNDLE_IDENTIFIER = cloud.Mindbox; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -4163,12 +4170,14 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 2; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; INFOPLIST_FILE = Mindbox/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( @@ -4176,7 +4185,9 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); + MACOSX_DEPLOYMENT_TARGET = 11.0; MARKETING_VERSION = 2.7.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14"; PRODUCT_BUNDLE_IDENTIFIER = cloud.Mindbox; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -4189,7 +4200,6 @@ 313B234825ADEA0F00A1CB72 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = MindboxTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -4197,6 +4207,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); + MACOSX_DEPLOYMENT_TARGET = 11.0; PRODUCT_BUNDLE_IDENTIFIER = Mindbox.MindboxTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -4207,7 +4218,6 @@ 313B234925ADEA0F00A1CB72 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = MindboxTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -4215,6 +4225,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); + MACOSX_DEPLOYMENT_TARGET = 11.0; PRODUCT_BUNDLE_IDENTIFIER = Mindbox.MindboxTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -4226,12 +4237,14 @@ isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; + CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = N39VVWZXXP; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; INFOPLIST_FILE = MindboxNotifications/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; @@ -4240,7 +4253,9 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); + MACOSX_DEPLOYMENT_TARGET = 11.0; MARKETING_VERSION = 2.7.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14"; PRODUCT_BUNDLE_IDENTIFIER = cloud.MindboxNotifications; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -4254,12 +4269,14 @@ isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; + CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = N39VVWZXXP; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; INFOPLIST_FILE = MindboxNotifications/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; @@ -4268,7 +4285,9 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); + MACOSX_DEPLOYMENT_TARGET = 11.0; MARKETING_VERSION = 2.7.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14"; PRODUCT_BUNDLE_IDENTIFIER = cloud.MindboxNotifications; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -4281,7 +4300,6 @@ 3333C1AB2681D3CF00B60D84 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = N39VVWZXXP; INFOPLIST_FILE = MindboxNotificationsTests/Info.plist; @@ -4291,6 +4309,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); + MACOSX_DEPLOYMENT_TARGET = 11.0; PRODUCT_BUNDLE_IDENTIFIER = cloud.MindboxNotificationsTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -4301,7 +4320,6 @@ 3333C1AC2681D3CF00B60D84 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = N39VVWZXXP; INFOPLIST_FILE = MindboxNotificationsTests/Info.plist; @@ -4311,6 +4329,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); + MACOSX_DEPLOYMENT_TARGET = 11.0; PRODUCT_BUNDLE_IDENTIFIER = cloud.MindboxNotificationsTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -4322,6 +4341,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; @@ -4329,6 +4349,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2023 Mindbox. All rights reserved."; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -4338,7 +4359,9 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); + MACOSX_DEPLOYMENT_TARGET = 11.0; MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20"; PRODUCT_BUNDLE_IDENTIFIER = cloud.organization.MindboxLogger; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -4352,6 +4375,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; @@ -4359,6 +4383,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2023 Mindbox. All rights reserved."; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -4368,7 +4393,9 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); + MACOSX_DEPLOYMENT_TARGET = 11.0; MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20"; PRODUCT_BUNDLE_IDENTIFIER = cloud.organization.MindboxLogger; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -4381,13 +4408,13 @@ A17853CF29AF7E950072578F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = N39VVWZXXP; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MACOSX_DEPLOYMENT_TARGET = 11.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = cloud.organization.MindboxLoggerTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -4400,13 +4427,13 @@ A17853D029AF7E950072578F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = N39VVWZXXP; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MACOSX_DEPLOYMENT_TARGET = 11.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = cloud.organization.MindboxLoggerTests; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Mindbox.xcodeproj/xcshareddata/xcschemes/Mindbox.xcscheme b/Mindbox.xcodeproj/xcshareddata/xcschemes/Mindbox.xcscheme index e1a5f907..424ec3ef 100644 --- a/Mindbox.xcodeproj/xcshareddata/xcschemes/Mindbox.xcscheme +++ b/Mindbox.xcodeproj/xcshareddata/xcschemes/Mindbox.xcscheme @@ -1,6 +1,6 @@ Date: Fri, 11 Oct 2024 13:53:41 +0300 Subject: [PATCH 09/14] MBX-0000: MindboxTests fix warnings --- MindboxTests/Extensions/StringExtensionsTests.swift | 9 +++------ .../TestsMigrations/TestProtocolMigrations.swift | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/MindboxTests/Extensions/StringExtensionsTests.swift b/MindboxTests/Extensions/StringExtensionsTests.swift index e686b628..070ace20 100644 --- a/MindboxTests/Extensions/StringExtensionsTests.swift +++ b/MindboxTests/Extensions/StringExtensionsTests.swift @@ -89,12 +89,9 @@ final class StringExtensionsTests: XCTestCase { ] for str in testCases { - XCTContext.runActivity(named: "string(\(str)) parse with error") { activity in - do { - XCTAssertThrowsError(try String(str).parseTimeSpanToMillis()) { error in - XCTAssertEqual((error as NSError).domain, "Invalid timeSpan format") - } - } catch { + try XCTContext.runActivity(named: "string(\(str)) parse with error") { activity in + XCTAssertThrowsError(try String(str).parseTimeSpanToMillis()) { error in + XCTAssertEqual((error as NSError).domain, "Invalid timeSpan format") } } } diff --git a/MindboxTests/MigrationsTests/TestsMigrations/TestProtocolMigrations.swift b/MindboxTests/MigrationsTests/TestsMigrations/TestProtocolMigrations.swift index 7dad412c..d3a6fba4 100644 --- a/MindboxTests/MigrationsTests/TestsMigrations/TestProtocolMigrations.swift +++ b/MindboxTests/MigrationsTests/TestsMigrations/TestProtocolMigrations.swift @@ -73,8 +73,8 @@ final class TestProtocolMigration_3: MigrationProtocol { func run() throws { // Do some code throw NSError(domain: "com.sdk.migration", code: -1, userInfo: [NSLocalizedDescriptionKey: "Invalid version for migration"]) - let versionCodeForMigration = persistenceStorage.versionCodeForMigration! - persistenceStorage.versionCodeForMigration = versionCodeForMigration + 1 + // let versionCodeForMigration = persistenceStorage.versionCodeForMigration! + // persistenceStorage.versionCodeForMigration = versionCodeForMigration + 1 } init(persistenceStorage: PersistenceStorage) { From 30706ded4260dd2266553ba1f324aea6fe6233de Mon Sep 17 00:00:00 2001 From: justSmK <28645140+justSmK@users.noreply.github.com> Date: Fri, 11 Oct 2024 13:59:58 +0300 Subject: [PATCH 10/14] MBX-0000: MindboxTests fix `@unchecked Sendable` --- .../Utilities/UUIDDebugService/MockNotificationCenter.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MindboxTests/Utilities/UUIDDebugService/MockNotificationCenter.swift b/MindboxTests/Utilities/UUIDDebugService/MockNotificationCenter.swift index b85819ed..52af3cee 100644 --- a/MindboxTests/Utilities/UUIDDebugService/MockNotificationCenter.swift +++ b/MindboxTests/Utilities/UUIDDebugService/MockNotificationCenter.swift @@ -7,4 +7,4 @@ import Foundation -final class MockNotificationCenter: NotificationCenter {} +final class MockNotificationCenter: NotificationCenter, @unchecked Sendable {} From 0c4a79d3831a16e2c67735151f14ff2a9f56d4ed Mon Sep 17 00:00:00 2001 From: justSmK <28645140+justSmK@users.noreply.github.com> Date: Fri, 11 Oct 2024 14:03:33 +0300 Subject: [PATCH 11/14] MBX-0000: MindboxTests Suppress `deprecated` shownInAppsIds warning --- MindboxTests/MigrationsTests/MigrationManagerTests.swift | 1 + .../MigrationsTests/ShownInAppsIdsMigrationTests.swift | 3 +++ 2 files changed, 4 insertions(+) diff --git a/MindboxTests/MigrationsTests/MigrationManagerTests.swift b/MindboxTests/MigrationsTests/MigrationManagerTests.swift index 4dc3c4dd..5a385e99 100644 --- a/MindboxTests/MigrationsTests/MigrationManagerTests.swift +++ b/MindboxTests/MigrationsTests/MigrationManagerTests.swift @@ -44,6 +44,7 @@ final class MigrationManagerTests: XCTestCase { super.tearDown() } + @available(*, deprecated, message: "Suppress `deprecated` shownInAppsIds warning") func testGeneralProductionMigrations() { migrationManager = MigrationManager(persistenceStorage: persistenceStorageMock) XCTAssertTrue(persistenceStorageMock.versionCodeForMigration == 0) diff --git a/MindboxTests/MigrationsTests/ShownInAppsIdsMigrationTests.swift b/MindboxTests/MigrationsTests/ShownInAppsIdsMigrationTests.swift index d34a4dfd..52ddf72b 100644 --- a/MindboxTests/MigrationsTests/ShownInAppsIdsMigrationTests.swift +++ b/MindboxTests/MigrationsTests/ShownInAppsIdsMigrationTests.swift @@ -23,6 +23,7 @@ final class ShownInAppsIdsMigrationTests: XCTestCase { "37bed734-aa34-4c10-918b-873f67505d46" ] + @available(*, deprecated, message: "Suppress `deprecated` shownInAppsIds warning") override func setUp() { super.setUp() shownInAppsIdsMigration = MigrationShownInAppsIds() @@ -54,6 +55,7 @@ final class ShownInAppsIdsMigrationTests: XCTestCase { super.tearDown() } + @available(*, deprecated, message: "Suppress `deprecated` shownInAppsIds warning") func test_ShownInAppsIdsMigration_withIsNeededTrue_shouldPerfromSuccessfully() throws { try mbLoggerCDManager.deleteAll() @@ -81,6 +83,7 @@ final class ShownInAppsIdsMigrationTests: XCTestCase { XCTAssertEqual(lastLog?.message, expectedLogMessage) } + @available(*, deprecated, message: "Suppress `deprecated` shownInAppsIds warning") func test_ShownInAppsIdsMigration_withIsNeededFalse_shouldHaveBeenSkipped() throws { try mbLoggerCDManager.deleteAll() From d6267188fb70e509635401607994e061dd9c78d4 Mon Sep 17 00:00:00 2001 From: justSmK <28645140+justSmK@users.noreply.github.com> Date: Fri, 11 Oct 2024 14:11:43 +0300 Subject: [PATCH 12/14] MBX-0000: MindboxTests fix InAppTargetingRequestsTests with deprecated --- .../InAppTargetingRequestsTests.swift | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/MindboxTests/InApp/Tests/InAppConfigResponseTests/InAppTargetingRequestsTests.swift b/MindboxTests/InApp/Tests/InAppConfigResponseTests/InAppTargetingRequestsTests.swift index 6767db10..a71ddf38 100644 --- a/MindboxTests/InApp/Tests/InAppConfigResponseTests/InAppTargetingRequestsTests.swift +++ b/MindboxTests/InApp/Tests/InAppConfigResponseTests/InAppTargetingRequestsTests.swift @@ -56,7 +56,7 @@ class InAppTargetingRequestsTests: XCTestCase { func test_TwoInappsTrue_FirstShownBefore() { let expectation = XCTestExpectation(description: "Waiting for sendRemainingInappsTargeting to complete") - persistenceStorage.shownInAppsIds = ["1"] +// persistenceStorage.shownInAppsIds = ["1"] do { let config = try getConfig(name: "3-4-5-TargetingRequests") mapper.mapConfigResponse(nil, config) { _ in @@ -115,7 +115,6 @@ class InAppTargetingRequestsTests: XCTestCase { let expectationForsendRemainingInappsTargeting = XCTestExpectation(description: "Waiting for first sendRemainingInappsTargeting to complete") let expectationForMapConfigResponse = XCTestExpectation(description: "Waiting for mapConfigResponse to complete") - persistenceStorage.shownInAppsIds = ["1"] do { let config = try getConfig(name: "9-TargetingRequests") targetingChecker.geoModels = .init(city: 1, region: 2, country: 3) @@ -184,8 +183,6 @@ class InAppTargetingRequestsTests: XCTestCase { let expectationTrue = XCTestExpectation(description: "True") let expectationTest = XCTestExpectation(description: "Operation test") let expectationTestAgain = XCTestExpectation(description: "Operation test again") - - persistenceStorage.shownInAppsIds = ["1"] do { let config = try getConfig(name: "16-17-TargetingRequests") From 21fdb4e1acfa1c255f02b8f4968da558620ee383 Mon Sep 17 00:00:00 2001 From: justSmK <28645140+justSmK@users.noreply.github.com> Date: Fri, 11 Oct 2024 14:13:21 +0300 Subject: [PATCH 13/14] MBX-0000: MindboxTests fix immutable value 'i' was never used --- MindboxTests/MindboxLogger/MBLoggerCoreDataManagerTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MindboxTests/MindboxLogger/MBLoggerCoreDataManagerTests.swift b/MindboxTests/MindboxLogger/MBLoggerCoreDataManagerTests.swift index 2acbe92d..f3f085c0 100644 --- a/MindboxTests/MindboxLogger/MBLoggerCoreDataManagerTests.swift +++ b/MindboxTests/MindboxLogger/MBLoggerCoreDataManagerTests.swift @@ -44,7 +44,7 @@ final class MBLoggerCoreDataManagerTests: XCTestCase { fetchExpectation.expectedFulfillmentCount = logsCount let message = "Test message" let timestamp = Date() - for i in 0.. Date: Tue, 15 Oct 2024 16:59:46 +0300 Subject: [PATCH 14/14] MBX-0000: Remove commented line --- .../InAppConfigResponseTests/InAppTargetingRequestsTests.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/MindboxTests/InApp/Tests/InAppConfigResponseTests/InAppTargetingRequestsTests.swift b/MindboxTests/InApp/Tests/InAppConfigResponseTests/InAppTargetingRequestsTests.swift index a71ddf38..c39e4606 100644 --- a/MindboxTests/InApp/Tests/InAppConfigResponseTests/InAppTargetingRequestsTests.swift +++ b/MindboxTests/InApp/Tests/InAppConfigResponseTests/InAppTargetingRequestsTests.swift @@ -56,7 +56,6 @@ class InAppTargetingRequestsTests: XCTestCase { func test_TwoInappsTrue_FirstShownBefore() { let expectation = XCTestExpectation(description: "Waiting for sendRemainingInappsTargeting to complete") -// persistenceStorage.shownInAppsIds = ["1"] do { let config = try getConfig(name: "3-4-5-TargetingRequests") mapper.mapConfigResponse(nil, config) { _ in