From 641006d8cca86db0737e4c2ecb52b8aab4600f48 Mon Sep 17 00:00:00 2001 From: Sergey Korney Date: Tue, 28 May 2024 19:30:48 +0500 Subject: [PATCH] 1.6.32 --- AffiseAttributionLib.podspec | 2 +- AffiseAttributionLib/Classes/Affise.swift | 8 +---- .../Classes/events/OnSendFailedCallback.swift | 2 +- .../init/AffSDKVersionProvider.swift | 2 +- AffiseInternal.podspec | 2 +- AffiseInternal/Classes/AffiseApiMethod.swift | 1 - AffiseInternal/Classes/AffiseApiWrapper.swift | 30 ++++++++++--------- AffiseModule.podspec | 2 +- AffiseSKAdNetwork.podspec | 2 +- CHANGELOG.md | 11 +++++++ README.md | 30 +++++++++---------- 11 files changed, 49 insertions(+), 43 deletions(-) diff --git a/AffiseAttributionLib.podspec b/AffiseAttributionLib.podspec index 9c340c4..f464009 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.31" + spec.version = ENV['LIB_VERSION'] || "1.6.32" 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/Affise.swift b/AffiseAttributionLib/Classes/Affise.swift index 8338180..4e0596d 100644 --- a/AffiseAttributionLib/Classes/Affise.swift +++ b/AffiseAttributionLib/Classes/Affise.swift @@ -57,13 +57,7 @@ public final class Affise: NSObject { */ @objc internal static func sendEventNow(_ event: Event, _ success: @escaping OnSendSuccessCallback, _ failed: @escaping OnSendFailedCallback) { - api?.immediateSendToServerUseCase.sendNow(event: event, success: success) { response in - let toSave = failed(response) - if toSave { - api?.storeEventUseCase.storeEvent(event: event) - } - return toSave - } + api?.immediateSendToServerUseCase.sendNow(event: event, success: success, failed: failed) } /** diff --git a/AffiseAttributionLib/Classes/events/OnSendFailedCallback.swift b/AffiseAttributionLib/Classes/events/OnSendFailedCallback.swift index c4a9089..4c6bbc8 100644 --- a/AffiseAttributionLib/Classes/events/OnSendFailedCallback.swift +++ b/AffiseAttributionLib/Classes/events/OnSendFailedCallback.swift @@ -1 +1 @@ -public typealias OnSendFailedCallback = (_ status: HttpResponse) -> Bool \ No newline at end of file +public typealias OnSendFailedCallback = (_ status: HttpResponse) -> Void \ No newline at end of file diff --git a/AffiseAttributionLib/Classes/parameters/providers/init/AffSDKVersionProvider.swift b/AffiseAttributionLib/Classes/parameters/providers/init/AffSDKVersionProvider.swift index 6d94c00..3b4752a 100644 --- a/AffiseAttributionLib/Classes/parameters/providers/init/AffSDKVersionProvider.swift +++ b/AffiseAttributionLib/Classes/parameters/providers/init/AffSDKVersionProvider.swift @@ -6,7 +6,7 @@ import Foundation class AffSDKVersionProvider: StringPropertyProvider { override func provide() -> String? { - return "1.6.31" + return "1.6.32" } public override func getOrder() -> Float { diff --git a/AffiseInternal.podspec b/AffiseInternal.podspec index 660bc83..b58a7c6 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.31" + spec.version = ENV['LIB_VERSION'] || "1.6.32" spec.summary = "Affise Internal library" spec.description = "Affise Internal wrapper library for crossplatform" spec.homepage = "https://github.com/affise/sdk-ios" diff --git a/AffiseInternal/Classes/AffiseApiMethod.swift b/AffiseInternal/Classes/AffiseApiMethod.swift index 73e3e04..77dacc3 100644 --- a/AffiseInternal/Classes/AffiseApiMethod.swift +++ b/AffiseInternal/Classes/AffiseApiMethod.swift @@ -44,7 +44,6 @@ public enum AffiseApiMethod: Int { switch self { case .INIT: return "init" case .IS_INITIALIZED: return "is_initialized" -// case .SEND_EVENTS: return "send_events" // deprecated case .SEND_EVENT: return "send_event" case .SEND_EVENT_NOW: return "send_event_now" case .ADD_PUSH_TOKEN: return "add_push_token" diff --git a/AffiseInternal/Classes/AffiseApiWrapper.swift b/AffiseInternal/Classes/AffiseApiWrapper.swift index 58b2467..77d3704 100644 --- a/AffiseInternal/Classes/AffiseApiWrapper.swift +++ b/AffiseInternal/Classes/AffiseApiWrapper.swift @@ -5,12 +5,13 @@ import AffiseAttributionLib @objc public class AffiseApiWrapper: NSObject { private let UUID: String = "callback_uuid" + private let TAG: String = "callback_tag" private let factory = AffiseEventFactory() private let affiseBuilder = AffiseBuilder() - public typealias OnCallback = (_ api: String, _ data: [String: Any?]) -> [String: Any?]? - public typealias OnAffiseCallback = (_ api: String, _ data: String) -> String? + public typealias OnCallback = (_ api: String, _ data: [String: Any?]) -> Void + public typealias OnAffiseCallback = (_ api: String, _ data: String) -> Void private var callback: OnCallback? = nil @@ -26,8 +27,7 @@ public class AffiseApiWrapper: NSObject { @objc(callback:) public func setCallback(_ callback: @escaping OnAffiseCallback) { self.callback = { apiName, map in - let result = callback(apiName, map.toArray().jsonString()) - return result?.toJsonMap() + callback(apiName, map.toArray().jsonString()) } } @@ -171,18 +171,20 @@ public class AffiseApiWrapper: NSObject { event.sendNow({ let data: [String: Any?] = [ self.UUID: uuid, + self.TAG: "success", ] - let _ = self.callback?(api.method, data) + self.callback?(api.method, data) }) { response in let data: [String: Any?] = [ self.UUID: uuid, + self.TAG: "failed", api.method: [ "code": response.code, "message": response.message, "body": "\(response.body?.toJsonGuardString() ?? "")", ], ] - return self.callback?(api.method, data)?.opt(api) ?? true + self.callback?(api.method, data) } result?.success(nil) @@ -325,7 +327,7 @@ public class AffiseApiWrapper: NSObject { self.UUID: uuid, api.method: referrer, ] - let _ = self.callback?(api.method, data) + self.callback?(api.method, data) } result?.success(nil) @@ -352,7 +354,7 @@ public class AffiseApiWrapper: NSObject { self.UUID: uuid, api.method: value, ] - let _ = self.callback?(api.method, data) + self.callback?(api.method, data) } result?.success(nil) @@ -379,7 +381,7 @@ public class AffiseApiWrapper: NSObject { self.UUID: uuid, api.method: status.toListOfMap(), ] - let _ = self.callback?(api.method, data) + self.callback?(api.method, data) } result?.success(nil) } @@ -395,7 +397,7 @@ public class AffiseApiWrapper: NSObject { self.UUID: uuid, api.method: uri?.absoluteString ?? "", ] - let _ = self.callback?(api.method, data) + self.callback?(api.method, data) } result?.success(nil) } @@ -411,7 +413,7 @@ public class AffiseApiWrapper: NSObject { self.UUID: uuid, api.method: error, ] - let _ = self.callback?(api.method, data) + self.callback?(api.method, data) } } @@ -438,7 +440,7 @@ public class AffiseApiWrapper: NSObject { self.UUID: uuid, api.method: error, ] - let _ = self.callback?(api.method, data) + self.callback?(api.method, data) } } @@ -453,7 +455,7 @@ public class AffiseApiWrapper: NSObject { self.UUID: uuid, api.method: status.status, ] - let _ = self.callback?(api.method, data) + self.callback?(api.method, data) } } @@ -474,7 +476,7 @@ public class AffiseApiWrapper: NSObject { ], ] ] - let _ = self.callback?(api.method, data) + self.callback?(api.method, data) } } diff --git a/AffiseModule.podspec b/AffiseModule.podspec index 3761d89..e2ac950 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.31" + s.version = ENV["LIB_VERSION"] || "1.6.32" s.summary = "Affise Modules" s.description = "Affise module collection" s.homepage = "https://github.com/affise/sdk-ios" diff --git a/AffiseSKAdNetwork.podspec b/AffiseSKAdNetwork.podspec index 459705d..14725d6 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.31" + spec.version = ENV['LIB_VERSION'] || "1.6.32" 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 76e52a7..29c8332 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [1.6.32] - 2024-05-28 + +### Removed + +- Result for failed `sendEvents`. + +### Changed + +- Update `internal` library for crossplatform. + ## [1.6.31] - 2024-05-17 ### Fixed @@ -39,6 +49,7 @@ - Improve `AffiseModuleManager` - Update for demo app +[1.6.32]: https://github.com/affise/sdk-ios/compare/1.6.31...1.6.32 [1.6.31]: https://github.com/affise/sdk-ios/compare/1.6.30...1.6.31 [1.6.30]: https://github.com/affise/sdk-ios/compare/1.6.29...1.6.30 [1.6.29]: https://github.com/affise/sdk-ios/compare/1.6.28...1.6.29 diff --git a/README.md b/README.md index 5ef24bf..4b259bb 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,10 @@ | Pod | Version | | ---- |:-------:| -| `AffiseAttributionLib` | [`1.6.31`](https://github.com/CocoaPods/Specs/tree/master/Specs/a/9/3/AffiseAttributionLib) | -| `AffiseSKAdNetwork` | [`1.6.31`](https://github.com/CocoaPods/Specs/tree/master/Specs/3/6/f/AffiseSKAdNetwork) | -| `AffiseModule/Advertising` | [`1.6.31`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | -| `AffiseModule/Status` | [`1.6.31`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | +| `AffiseAttributionLib` | [`1.6.32`](https://github.com/CocoaPods/Specs/tree/master/Specs/a/9/3/AffiseAttributionLib) | +| `AffiseSKAdNetwork` | [`1.6.32`](https://github.com/CocoaPods/Specs/tree/master/Specs/3/6/f/AffiseSKAdNetwork) | +| `AffiseModule/Advertising` | [`1.6.32`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | +| `AffiseModule/Status` | [`1.6.32`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | - [Affise Attribution iOS Library](#affise-attribution-ios-library) - [Description](#description) @@ -76,20 +76,20 @@ To add the SDK using Cocoapods, specify the version you want to use in your Podf ```ruby # Affise SDK library -pod 'AffiseAttributionLib', '~> 1.6.31' +pod 'AffiseAttributionLib', '~> 1.6.32' # Affise modules -pod 'AffiseModule/Advertising', '~> 1.6.31' -pod 'AffiseModule/Status', '~> 1.6.31' +pod 'AffiseModule/Advertising', '~> 1.6.32' +pod 'AffiseModule/Status', '~> 1.6.32' ``` Get source directly from GitHub ```ruby # Affise SDK library -pod 'AffiseAttributionLib', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.31' +pod 'AffiseAttributionLib', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.32' # Affise modules -pod 'AffiseModule/Advertising', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.31' -pod 'AffiseModule/Status', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.31' +pod 'AffiseModule/Advertising', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.32' +pod 'AffiseModule/Status', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.32' ``` ### Integrate as Swift Package Manager @@ -191,8 +191,8 @@ Affise | Module | Version | Start | | ------------- |:------------------------------------------------------------------------------------:|----------| -| `Advertising` | [`1.6.31`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Manual` | -| `Status` | [`1.6.31`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto` | +| `Advertising` | [`1.6.32`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Manual` | +| `Status` | [`1.6.32`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto` | If module start type is `manual`, then call: @@ -244,14 +244,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.31' +pod 'AffiseSKAdNetwork', '~> 1.6.32' ``` Get source directly from GitHub ```ruby # Wrapper for StoreKit Ad Network -pod 'AffiseSKAdNetwork', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.31' +pod 'AffiseSKAdNetwork', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.32' ``` For `swift` use: @@ -445,7 +445,7 @@ AddToCartEvent() // handle event send success }) { errorResponse in // handle event send failed - return true // return true to cache event to later scheduled send + // Warning: event is NOT cached for later send } ```