Skip to content

Commit

Permalink
Merge pull request #438 from mindbox-cloud/release/2.11.0
Browse files Browse the repository at this point in the history
Release/2.11.0
  • Loading branch information
AndreyEmtsov authored Aug 30, 2024
2 parents 14b6f6b + b54469c commit d5b1433
Show file tree
Hide file tree
Showing 117 changed files with 3,230 additions and 1,929 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class NotificationService: UNNotificationServiceExtension {
lazy var mindboxService = MindboxNotificationService()

override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {

if let mindboxPushNotification = Mindbox.shared.getMindboxPushData(userInfo: request.content.userInfo) {
Task {
await saveSwiftDataItem(mindboxPushNotification)
Expand Down
6 changes: 3 additions & 3 deletions Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use_frameworks!

target 'Example' do
pod 'Mindbox', '2.10.3-rc'
pod 'Mindbox', '2.11.0'
end

target 'MindboxNotificationServiceExtension' do
pod 'MindboxNotifications', '2.10.3-rc'
pod 'MindboxNotifications', '2.11.0'
end

target 'MindboxNotificationContentExtension' do
pod 'MindboxNotifications', '2.10.3-rc'
pod 'MindboxNotifications', '2.11.0'
end
32 changes: 16 additions & 16 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ GEM
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.3.0)
aws-partitions (1.949.0)
aws-sdk-core (3.200.0)
aws-partitions (1.960.0)
aws-sdk-core (3.201.3)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.87.0)
aws-sdk-core (~> 3, >= 3.199.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.155.0)
aws-sdk-core (~> 3, >= 3.199.0)
aws-sdk-kms (1.88.0)
aws-sdk-core (~> 3, >= 3.201.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.156.0)
aws-sdk-core (~> 3, >= 3.201.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.8)
aws-sigv4 (1.8.0)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.9.1)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
base64 (0.2.0)
Expand Down Expand Up @@ -95,7 +95,7 @@ GEM
escape (0.0.4)
ethon (0.16.0)
ffi (>= 1.15.0)
excon (0.110.0)
excon (0.111.0)
faraday (1.10.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
Expand All @@ -117,15 +117,15 @@ GEM
faraday-httpclient (1.0.1)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-net_http (1.0.1)
faraday-net_http (1.0.2)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
faraday_middleware (1.2.0)
faraday (~> 1.0)
fastimage (2.3.1)
fastlane (2.221.1)
fastlane (2.222.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
Expand Down Expand Up @@ -218,7 +218,7 @@ GEM
json (2.7.2)
jwt (2.8.2)
base64
mini_magick (4.13.1)
mini_magick (4.13.2)
mini_mime (1.1.5)
minitest (5.24.1)
molinillo (0.8.0)
Expand All @@ -240,7 +240,7 @@ GEM
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rexml (3.2.9)
rexml (3.3.6)
strscan
rouge (2.0.7)
ruby-macho (2.5.1)
Expand Down Expand Up @@ -271,13 +271,13 @@ GEM
uber (0.1.0)
unicode-display_width (2.5.0)
word_wrap (1.0.0)
xcodeproj (1.24.0)
xcodeproj (1.25.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
rexml (>= 3.3.2, < 4.0)
xcpretty (0.3.0)
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.1)
Expand Down
6 changes: 3 additions & 3 deletions Mindbox.podspec
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
Pod::Spec.new do |spec|
spec.name = "Mindbox"
spec.version = "2.10.3-rc"
spec.version = "2.11.0"
spec.summary = "SDK for integration with Mindbox"
spec.description = "This library allows you to integrate data transfer to Mindbox Marketing Cloud"
spec.homepage = "https://github.com/mindbox-cloud/ios-sdk"
spec.license = { :type => "CC BY-NC-ND 4.0", :file => "LICENSE.md" }
spec.author = { "Mindbox" => "[email protected]" }
spec.platform = :ios, "10.0"
spec.platform = :ios, "12.0"
spec.source = { :git => "https://github.com/mindbox-cloud/ios-sdk.git", :tag => spec.version }
spec.source_files = "Mindbox/**/*.{swift}", "SDKVersionProvider/**/*.{swift}"
spec.exclude_files = "Classes/Exclude"
spec.resource_bundles = {
'Mindbox' => ['Mindbox/**/*.xcassets', 'Mindbox/**/*.xcdatamodeld', 'Mindbox/**/*.xcprivacy']
}
spec.swift_version = "5"
spec.dependency 'MindboxLogger', '2.10.3-rc'
spec.dependency 'MindboxLogger', '2.11.0'

end
354 changes: 229 additions & 125 deletions Mindbox.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,18 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES"
onlyGenerateCoverageForSpecifiedTargets = "YES">
<CodeCoverageTargets>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3333C1972681D3CF00B60D84"
BuildableName = "MindboxNotifications.framework"
BlueprintName = "MindboxNotifications"
ReferencedContainer = "container:Mindbox.xcodeproj">
</BuildableReference>
</CodeCoverageTargets>
<Testables>
<TestableReference
skipped = "NO">
Expand Down
16 changes: 9 additions & 7 deletions Mindbox/CoreController/CoreController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import MindboxLogger
final class CoreController {
private let persistenceStorage: PersistenceStorage
private let utilitiesFetcher: UtilitiesFetcher
private let notificationStatusProvider: UNAuthorizationStatusProviding
private let databaseRepository: MBDatabaseRepository
private let guaranteedDeliveryManager: GuaranteedDeliveryManager
private let trackVisitManager: TrackVisitManager
Expand All @@ -31,13 +30,16 @@ final class CoreController {
SessionTemporaryStorage.shared.isInstalledFromPersistenceStorageBeforeInitSDK = self.persistenceStorage.isInstalled
SessionTemporaryStorage.shared.isInitializationCalled = true

DI.injectOrFail(MigrationManagerProtocol.self).migrate()

self.configValidation.compare(configuration, self.persistenceStorage.configuration)
self.persistenceStorage.configuration = configuration
if !self.persistenceStorage.isInstalled {
self.primaryInitialization(with: configuration)
} else {
self.repeatInitialization(with: configuration)
}

self.guaranteedDeliveryManager.canScheduleOperations = true

let appStateMessage = "[App State]: \(UIApplication.shared.appStateDescription)"
Expand Down Expand Up @@ -92,6 +94,7 @@ final class CoreController {

// MARK: - Private
private func notificationStatus() -> Bool {
let notificationStatusProvider = DI.injectOrFail(UNAuthorizationStatusProviding.self)
let lock = DispatchSemaphore(value: 0)
var isNotificationsEnabled = false
notificationStatusProvider.getStatus {
Expand Down Expand Up @@ -147,7 +150,6 @@ final class CoreController {

private func startUUIDDebugServiceIfNeeded(deviceUUID: String, configuration: MBConfiguration) {
guard configuration.uuidDebugEnabled else { return }

uuidDebugService.start(with: deviceUUID)
}

Expand Down Expand Up @@ -241,7 +243,6 @@ final class CoreController {
init(
persistenceStorage: PersistenceStorage,
utilitiesFetcher: UtilitiesFetcher,
notificationStatusProvider: UNAuthorizationStatusProviding,
databaseRepository: MBDatabaseRepository,
guaranteedDeliveryManager: GuaranteedDeliveryManager,
trackVisitManager: TrackVisitManager,
Expand All @@ -253,7 +254,6 @@ final class CoreController {
) {
self.persistenceStorage = persistenceStorage
self.utilitiesFetcher = utilitiesFetcher
self.notificationStatusProvider = notificationStatusProvider
self.databaseRepository = databaseRepository
self.guaranteedDeliveryManager = guaranteedDeliveryManager
self.trackVisitManager = trackVisitManager
Expand All @@ -272,11 +272,13 @@ final class CoreController {
}
}
}

TimerManager.shared.configurate(trackEvery: 20 * 60) {

let timer = DI.injectOrFail(TimerManager.self)
timer.configurate(trackEvery: 20 * 60) {
Logger.common(message: "Scheduled Time tracker started")
sessionManager.trackForeground()
}
TimerManager.shared.setupTimer()

timer.setupTimer()
}
}
9 changes: 5 additions & 4 deletions Mindbox/CoreController/TimerManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import MindboxLogger

public final class TimerManager {

public static let shared = TimerManager()

internal var didEnterBackgroundApplication: NSObjectProtocol?
internal var didBecomeActiveApplication: NSObjectProtocol?

Expand All @@ -23,6 +21,7 @@ public final class TimerManager {
}
}
}

internal var deadline: TimeInterval? = nil

internal var seconds: TimeInterval = 0 {
Expand Down Expand Up @@ -93,11 +92,13 @@ public final class TimerManager {
}
self.seconds = 0

TimerManager.shared.timer = Timer(timeInterval: 1, repeats: true) { [weak self] _ in
timer = Timer(timeInterval: 1, repeats: true) { [weak self] _ in
self?.seconds += 1
}

guard let timer = TimerManager.shared.timer else { return }
guard let timer = timer else {
return
}

RunLoop.main.add(timer, forMode: .common)
Logger.common(message: "The timer is running")
Expand Down
42 changes: 0 additions & 42 deletions Mindbox/DI/DependencyContainer.swift

This file was deleted.

Loading

0 comments on commit d5b1433

Please sign in to comment.