Skip to content

Commit

Permalink
1.6.32
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Korney committed May 28, 2024
1 parent 8dc931b commit 641006d
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 43 deletions.
2 changes: 1 addition & 1 deletion AffiseAttributionLib.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 1 addition & 7 deletions AffiseAttributionLib/Classes/Affise.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
public typealias OnSendFailedCallback = (_ status: HttpResponse) -> Bool
public typealias OnSendFailedCallback = (_ status: HttpResponse) -> Void
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion AffiseInternal.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion AffiseInternal/Classes/AffiseApiMethod.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
30 changes: 16 additions & 14 deletions AffiseInternal/Classes/AffiseApiWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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())
}
}

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
}
Expand All @@ -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)
}
Expand All @@ -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)
}
}

Expand All @@ -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)
}
}

Expand All @@ -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)
}
}

Expand All @@ -474,7 +476,7 @@ public class AffiseApiWrapper: NSObject {
],
]
]
let _ = self.callback?(api.method, data)
self.callback?(api.method, data)
}
}

Expand Down
2 changes: 1 addition & 1 deletion AffiseModule.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion AffiseSKAdNetwork.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
}
```

Expand Down

0 comments on commit 641006d

Please sign in to comment.