From 780d06a9b71d77ef570a208ab590f02bd78976c4 Mon Sep 17 00:00:00 2001 From: Sergey Korney Date: Thu, 3 Oct 2024 18:18:17 +0500 Subject: [PATCH] 1.6.42 --- AffiseAttributionLib.podspec | 2 +- .../Classes/internal/BuildConfig.swift | 2 +- AffiseInternal.podspec | 2 +- AffiseModule.podspec | 2 +- .../Classes/AdvertisingModule.swift | 2 +- AffiseModule/Link/Classes/LinkModule.swift | 2 +- .../Status/Classes/StatusModule.swift | 2 +- .../usecase/CheckStatusUseCaseImpl.swift | 26 ++++++----- .../Classes/SubscriptionModule.swift | 2 +- .../store/storekit2/ProductManagerSK2.swift | 2 +- .../Classes/utils/StoreKit2Ext.swift | 1 - AffiseSKAdNetwork.podspec | 2 +- CHANGELOG.md | 7 +++ README.md | 44 +++++++++---------- 14 files changed, 54 insertions(+), 44 deletions(-) diff --git a/AffiseAttributionLib.podspec b/AffiseAttributionLib.podspec index e00906b..4c3b864 100644 --- a/AffiseAttributionLib.podspec +++ b/AffiseAttributionLib.podspec @@ -5,7 +5,7 @@ Pod::Spec.new do |spec| spec.name = "AffiseAttributionLib" - spec.version = ENV['LIB_VERSION'] || "1.6.41" + spec.version = ENV['LIB_VERSION'] || "1.6.42" spec.summary = "Affise Attribution iOS library" spec.description = "Affise SDK is a software you can use to collect app usage statistics, device identifiers, deeplink usage, track install referrer." spec.homepage = "https://github.com/affise/sdk-ios" diff --git a/AffiseAttributionLib/Classes/internal/BuildConfig.swift b/AffiseAttributionLib/Classes/internal/BuildConfig.swift index 90e4a7d..b5455df 100644 --- a/AffiseAttributionLib/Classes/internal/BuildConfig.swift +++ b/AffiseAttributionLib/Classes/internal/BuildConfig.swift @@ -1,5 +1,5 @@ import Foundation internal struct BuildConfig { - static let AFFISE_VERSION = "1.6.41" + static let AFFISE_VERSION = "1.6.42" } diff --git a/AffiseInternal.podspec b/AffiseInternal.podspec index 667ca62..1659059 100644 --- a/AffiseInternal.podspec +++ b/AffiseInternal.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |spec| spec.name = "AffiseInternal" - spec.version = ENV['LIB_VERSION'] || "1.6.41" + spec.version = ENV['LIB_VERSION'] || "1.6.42" spec.summary = "Affise Internal library" spec.description = "Affise Internal wrapper library for crossplatform" spec.homepage = "https://github.com/affise/sdk-ios" diff --git a/AffiseModule.podspec b/AffiseModule.podspec index 85c566c..a41b9ff 100644 --- a/AffiseModule.podspec +++ b/AffiseModule.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = "AffiseModule" - s.version = ENV["LIB_VERSION"] || "1.6.41" + s.version = ENV["LIB_VERSION"] || "1.6.42" s.summary = "Affise Modules" s.description = "Affise module collection" s.homepage = "https://github.com/affise/sdk-ios" diff --git a/AffiseModule/Advertising/Classes/AdvertisingModule.swift b/AffiseModule/Advertising/Classes/AdvertisingModule.swift index b899980..3efe006 100644 --- a/AffiseModule/Advertising/Classes/AdvertisingModule.swift +++ b/AffiseModule/Advertising/Classes/AdvertisingModule.swift @@ -4,7 +4,7 @@ import Foundation @objc(AffiseAdvertisingModule) public final class AdvertisingModule: AffiseModule { - public override var version: String { "1.6.41" } + public override var version: String { "1.6.42" } private lazy var advertisingIdManager: AdvertisingIdManager = AdvertisingIdManagerImpl() diff --git a/AffiseModule/Link/Classes/LinkModule.swift b/AffiseModule/Link/Classes/LinkModule.swift index d0e642b..d6af4ac 100644 --- a/AffiseModule/Link/Classes/LinkModule.swift +++ b/AffiseModule/Link/Classes/LinkModule.swift @@ -5,7 +5,7 @@ import AffiseAttributionLib @objc(AffiseLinkModule) public final class LinkModule: AffiseModule { - public override var version: String { "1.6.41" } + public override var version: String { "1.6.42" } private var useCase: LinkResolveUseCase? = nil diff --git a/AffiseModule/Status/Classes/StatusModule.swift b/AffiseModule/Status/Classes/StatusModule.swift index ad18ac1..cd413bf 100644 --- a/AffiseModule/Status/Classes/StatusModule.swift +++ b/AffiseModule/Status/Classes/StatusModule.swift @@ -5,7 +5,7 @@ import AffiseAttributionLib @objc(AffiseStatusModule) public final class StatusModule: AffiseModule { - public override var version: String { "1.6.41" } + public override var version: String { "1.6.42" } private var checkStatusUseCase: CheckStatusUseCase? = nil private var referrerUseCase: ReferrerUseCase? = nil diff --git a/AffiseModule/Status/Classes/usecase/CheckStatusUseCaseImpl.swift b/AffiseModule/Status/Classes/usecase/CheckStatusUseCaseImpl.swift index 67d4c8b..fadae74 100644 --- a/AffiseModule/Status/Classes/usecase/CheckStatusUseCaseImpl.swift +++ b/AffiseModule/Status/Classes/usecase/CheckStatusUseCaseImpl.swift @@ -3,8 +3,8 @@ import AffiseAttributionLib internal class CheckStatusUseCaseImpl { - private static let TIME_DELAY_SENDING: TimeInterval = 5 - private let ATTEMPTS_TO_SEND = 30 + private static let TIME_DELAY_SENDING: TimeInterval = 1 + private static let TIMINGS = Array([1,1,2,3,5,8,13].reversed()) private let TIMEOUT_SEND: TimeInterval = 30 let PATH: String = "check_status" @@ -68,15 +68,19 @@ extension CheckStatusUseCaseImpl: CheckStatusUseCase { func send(_ onComplete: @escaping OnKeyValueCallback) { DispatchQueue.global(qos:.background).async { [weak self] in - self?.sendWithRepeat(onComplete) { - Thread.sleep(forTimeInterval: CheckStatusUseCaseImpl.TIME_DELAY_SENDING) + self?.sendWithRepeat(onComplete) { attempt in + var i = 1 + if CheckStatusUseCaseImpl.TIMINGS.count > attempt { + i = CheckStatusUseCaseImpl.TIMINGS[attempt] + } + Thread.sleep(forTimeInterval: CheckStatusUseCaseImpl.TIME_DELAY_SENDING * Double(i)) } } } - func sendWithRepeat( _ onComplete: @escaping OnKeyValueCallback, onFailedAttempt: () -> Void) { + func sendWithRepeat( _ onComplete: @escaping OnKeyValueCallback, onFailedAttempt: (Int) -> Void) { //attempts to send - var attempts = ATTEMPTS_TO_SEND + var attempts = CheckStatusUseCaseImpl.TIMINGS.count + 1 //Send or not var send = false @@ -108,12 +112,12 @@ extension CheckStatusUseCaseImpl: CheckStatusUseCase { if (attempts == 0) { onComplete([]) - let httpResponse = response ?? postBackResponse - let error = AffiseError.network(status: httpResponse?.code ?? 0, message: httpResponse?.body) - //Log error - logsManager?.addSdkError(error: AffiseError.cloud(url: url, error: error, attempts: ATTEMPTS_TO_SEND, retry: true)) +// let httpResponse = response ?? postBackResponse +// let error = AffiseError.network(status: httpResponse?.code ?? 0, message: httpResponse?.body) +// //Log error +// logsManager?.addSdkError(error: AffiseError.cloud(url: url, error: error, attempts: CheckStatusUseCaseImpl.TIMINGS.count + 1, retry: true)) } else { - onFailedAttempt() + onFailedAttempt(attempts - 1) } } } diff --git a/AffiseModule/Subscription/Classes/SubscriptionModule.swift b/AffiseModule/Subscription/Classes/SubscriptionModule.swift index 40a8b04..3fe00f0 100644 --- a/AffiseModule/Subscription/Classes/SubscriptionModule.swift +++ b/AffiseModule/Subscription/Classes/SubscriptionModule.swift @@ -6,7 +6,7 @@ import AffiseAttributionLib @objc(AffiseSubscriptionModule) public final class SubscriptionModule: AffiseModule { - public override var version: String { "1.6.41" } + public override var version: String { "1.6.42" } lazy var storeManager: StoreManager = StoreManager() diff --git a/AffiseModule/Subscription/Classes/store/storekit2/ProductManagerSK2.swift b/AffiseModule/Subscription/Classes/store/storekit2/ProductManagerSK2.swift index 8f90c25..b64f1ae 100644 --- a/AffiseModule/Subscription/Classes/store/storekit2/ProductManagerSK2.swift +++ b/AffiseModule/Subscription/Classes/store/storekit2/ProductManagerSK2.swift @@ -46,6 +46,6 @@ extension ProductManagerSK2: ProductManager { } func product(_ id: String) -> Any { - return self.products[id] + return self.products[id] as Any } } diff --git a/AffiseModule/Subscription/Classes/utils/StoreKit2Ext.swift b/AffiseModule/Subscription/Classes/utils/StoreKit2Ext.swift index b584395..8f796be 100644 --- a/AffiseModule/Subscription/Classes/utils/StoreKit2Ext.swift +++ b/AffiseModule/Subscription/Classes/utils/StoreKit2Ext.swift @@ -34,7 +34,6 @@ internal extension Product { } func toAffiseProduct(_ type: AffiseProductType? = nil) -> AffiseProduct { - self.price return AffiseProduct( productId: self.id, title: self.displayName, diff --git a/AffiseSKAdNetwork.podspec b/AffiseSKAdNetwork.podspec index 47f97d6..998e7fc 100644 --- a/AffiseSKAdNetwork.podspec +++ b/AffiseSKAdNetwork.podspec @@ -5,7 +5,7 @@ Pod::Spec.new do |spec| spec.name = "AffiseSKAdNetwork" - spec.version = ENV['LIB_VERSION'] || "1.6.41" + spec.version = ENV['LIB_VERSION'] || "1.6.42" spec.summary = "AffiseSKAdNetwork iOS library" spec.description = "Affise library for StoreKit Ad Network (SKAdNetwork)" spec.homepage = "https://github.com/affise/sdk-ios" diff --git a/CHANGELOG.md b/CHANGELOG.md index 77041f3..de9deec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [1.6.42] - 2024-10-03 + +### Fixed + +- Fix `Affise.Module.getStatus` timing retry. + ## [1.6.41] - 2024-10-01 ### Added @@ -122,6 +128,7 @@ - Improve `AffiseModuleManager` - Update for demo app +[1.6.42]: https://github.com/affise/sdk-ios/compare/1.6.41...1.6.42 [1.6.41]: https://github.com/affise/sdk-ios/compare/1.6.40...1.6.41 [1.6.40]: https://github.com/affise/sdk-ios/compare/1.6.39...1.6.40 [1.6.39]: https://github.com/affise/sdk-ios/compare/1.6.38...1.6.39 diff --git a/README.md b/README.md index 2d54c39..9bdc40d 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,12 @@ | Pod | Version | | --------------------------- |:-------------------------:| -| `AffiseAttributionLib` | [`1.6.41`](https://github.com/CocoaPods/Specs/tree/master/Specs/a/9/3/AffiseAttributionLib) | -| `AffiseSKAdNetwork` | [`1.6.41`](https://github.com/CocoaPods/Specs/tree/master/Specs/3/6/f/AffiseSKAdNetwork) | -| `AffiseModule/Advertising` | [`1.6.41`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | -| `AffiseModule/Link` | [`1.6.41`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | -| `AffiseModule/Status` | [`1.6.41`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | -| `AffiseModule/Subscription` | [`1.6.41`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | +| `AffiseAttributionLib` | [`1.6.42`](https://github.com/CocoaPods/Specs/tree/master/Specs/a/9/3/AffiseAttributionLib) | +| `AffiseSKAdNetwork` | [`1.6.42`](https://github.com/CocoaPods/Specs/tree/master/Specs/3/6/f/AffiseSKAdNetwork) | +| `AffiseModule/Advertising` | [`1.6.42`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | +| `AffiseModule/Link` | [`1.6.42`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | +| `AffiseModule/Status` | [`1.6.42`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | +| `AffiseModule/Subscription` | [`1.6.42`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | - [Affise Attribution iOS Library](#affise-attribution-ios-library) - [Description](#description) @@ -85,24 +85,24 @@ To add the SDK using Cocoapods, specify the version you want to use in your Podf ```ruby # Affise SDK library -pod 'AffiseAttributionLib', '~> 1.6.41' +pod 'AffiseAttributionLib', '~> 1.6.42' # Affise modules -pod 'AffiseModule/Advertising', '~> 1.6.41' -pod 'AffiseModule/Link', '~> 1.6.41' -pod 'AffiseModule/Status', '~> 1.6.41' -pod 'AffiseModule/Subscription', '~> 1.6.41' +pod 'AffiseModule/Advertising', '~> 1.6.42' +pod 'AffiseModule/Link', '~> 1.6.42' +pod 'AffiseModule/Status', '~> 1.6.42' +pod 'AffiseModule/Subscription', '~> 1.6.42' ``` Get source directly from GitHub ```ruby # Affise SDK library -pod 'AffiseAttributionLib', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.41' +pod 'AffiseAttributionLib', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.42' # Affise modules -pod 'AffiseModule/Advertising', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.41' -pod 'AffiseModule/Link', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.41' -pod 'AffiseModule/Status', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.41' -pod 'AffiseModule/Subscription', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.41' +pod 'AffiseModule/Advertising', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.42' +pod 'AffiseModule/Link', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.42' +pod 'AffiseModule/Status', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.42' +pod 'AffiseModule/Subscription', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.42' ``` ### Integrate as Swift Package Manager @@ -204,10 +204,10 @@ Affise | Module | Version | Start | | -------------- |:------------------------------------------------------------------------------------:|----------| -| `Advertising` | [`1.6.41`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Manual` | -| `Link` | [`1.6.41`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto` | -| `Status` | [`1.6.41`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto` | -| `Subscription` | [`1.6.41`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto` | +| `Advertising` | [`1.6.42`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Manual` | +| `Link` | [`1.6.42`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto` | +| `Status` | [`1.6.42`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto` | +| `Subscription` | [`1.6.42`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto` | If module start type is `manual`, then call: @@ -311,14 +311,14 @@ To add the SDK using Cocoapods, specify the version you want to use in your Podf ```ruby # Wrapper for StoreKit Ad Network -pod 'AffiseSKAdNetwork', '~> 1.6.41' +pod 'AffiseSKAdNetwork', '~> 1.6.42' ``` Get source directly from GitHub ```ruby # Wrapper for StoreKit Ad Network -pod 'AffiseSKAdNetwork', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.41' +pod 'AffiseSKAdNetwork', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.42' ``` For `swift` use: