Skip to content

Commit

Permalink
1.6.23
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Korney committed Jan 26, 2024
1 parent ea6a390 commit 800f873
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 70 deletions.
4 changes: 2 additions & 2 deletions 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.22"
spec.version = ENV['LIB_VERSION'] || "1.6.23"
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 All @@ -18,6 +18,6 @@ Pod::Spec.new do |spec|

spec.source_files = "AffiseAttributionLib/Classes/**/*.{h,m,swift}"
spec.resources = "AffiseAttributionLib/Assets/*.{js}"
spec.ios.deployment_target = "9.0"
spec.ios.deployment_target = "10.0"
spec.swift_version = '5.7'
end
65 changes: 23 additions & 42 deletions AffiseAttributionLib/Classes/events/EventsManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ class EventsManager {
private let sendDataToServerUseCase: SendDataToServerUseCase
private let appLifecycleEventsManager: AppLifecycleEventsManager

init(sendDataToServerUseCase: SendDataToServerUseCase,
appLifecycleEventsManager: AppLifecycleEventsManager) {
init(
sendDataToServerUseCase: SendDataToServerUseCase,
appLifecycleEventsManager: AppLifecycleEventsManager
) {

self.sendDataToServerUseCase = sendDataToServerUseCase
self.appLifecycleEventsManager = appLifecycleEventsManager
Expand Down Expand Up @@ -71,59 +73,38 @@ class EventsManager {
* Start timer fo repeat send events
*/
private func startTimer() {
lockQueue.async(flags: .barrier) {
//Stop timer if running
self.stopTimer()

//Create timer
let timer = Timer(
timeInterval: EventsManager.TIME_SEND_REPEAT,
target: self,
selector: #selector(self.fireTimer),
userInfo: nil,
repeats: true
)

self.setTimer(timer)

DispatchQueue.main.async {
guard let timer = self.getTimer() else { return }
RunLoop.current.add(timer, forMode: .common)
}
//Stop timer if running
stopTimer()

//Create timer
timer = Timer.scheduledTimer(
withTimeInterval: EventsManager.TIME_SEND_REPEAT,
repeats: true
) { [weak self] _ in
self?.fireTimer()
}

DispatchQueue.main.async { [weak self] in
guard let timer = self?.timer else { return }
RunLoop.current.add(timer, forMode: .common)
}
}

/**
* Stop timer fo repeat send events
*/
private func stopTimer() {
lockQueue.async(flags: .barrier) {
if self.timer == nil { return }
self.timer?.invalidate()
self.timer = nil
}
if timer == nil { return }
//Stop timer
timer?.invalidate()
timer = nil
}

@objc

private func fireTimer() {
//Send events
sendEvents()

//Stop timer
stopTimer()
}

private let lockQueue = DispatchQueue(label: "com.affise.EventsManager", attributes: .concurrent)

func getTimer() -> Timer? {
lockQueue.sync {
return timer
}
}

func setTimer(_ timer: Timer?) {
lockQueue.async(flags: .barrier) {
self.timer = timer
}
}
}
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.22"
return "1.6.23"
}

public override func getOrder() -> Float {
Expand Down
4 changes: 2 additions & 2 deletions 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.22"
spec.version = ENV['LIB_VERSION'] || "1.6.23"
spec.summary = "Affise Internal library"
spec.description = "Affise Internal wrapper library for crossplatform"
spec.homepage = "https://github.com/affise/sdk-ios"
Expand All @@ -20,7 +20,7 @@ Pod::Spec.new do |spec|
}

spec.source_files = "AffiseInternal/Classes/**/*.{swift}"
spec.ios.deployment_target = "9.0"
spec.ios.deployment_target = "10.0"
spec.swift_version = '5.7'

spec.dependency "AffiseAttributionLib"
Expand Down
4 changes: 2 additions & 2 deletions 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.22"
s.version = ENV["LIB_VERSION"] || "1.6.23"
s.summary = "Affise Modules"
s.description = "Affise module collection"
s.homepage = "https://github.com/affise/sdk-ios"
Expand All @@ -20,7 +20,7 @@ Pod::Spec.new do |s|
:submodules => true
}

s.ios.deployment_target = "9.0"
s.ios.deployment_target = "10.0"
s.swift_version = "5.7"

s.dependency "AffiseAttributionLib"
Expand Down
4 changes: 2 additions & 2 deletions 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.22"
spec.version = ENV['LIB_VERSION'] || "1.6.23"
spec.summary = "AffiseSKAdNetwork iOS library"
spec.description = "Affise library for StoreKit Ad Network (SKAdNetwork)"
spec.homepage = "https://github.com/affise/sdk-ios"
Expand All @@ -18,7 +18,7 @@ Pod::Spec.new do |spec|

spec.source_files = "AffiseSKAdNetwork/**/*.{h,m,swift}"
spec.platform = "ios"
spec.ios.deployment_target = "9.0"
spec.ios.deployment_target = "10.0"
spec.swift_version = "5.7"

spec.framework = "StoreKit"
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import PackageDescription
let package = Package(
name: "Affise",
platforms: [
.iOS(.v9)
.iOS(.v10)
],
products: [
.library(name: "AffiseAttributionLib", targets: ["AffiseAttributionLib"]),
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

| Pod | Version |
| ---- |:-------:|
| `AffiseAttributionLib` | [`1.6.22`](https://github.com/CocoaPods/Specs/tree/master/Specs/a/9/3/AffiseAttributionLib) |
| `AffiseSKAdNetwork` | [`1.6.22`](https://github.com/CocoaPods/Specs/tree/master/Specs/3/6/f/AffiseSKAdNetwork) |
| `AffiseModule/Advertising` | [`1.6.22`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) |
| `AffiseModule/Status` | [`1.6.22`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) |
| `AffiseAttributionLib` | [`1.6.23`](https://github.com/CocoaPods/Specs/tree/master/Specs/a/9/3/AffiseAttributionLib) |
| `AffiseSKAdNetwork` | [`1.6.23`](https://github.com/CocoaPods/Specs/tree/master/Specs/3/6/f/AffiseSKAdNetwork) |
| `AffiseModule/Advertising` | [`1.6.23`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) |
| `AffiseModule/Status` | [`1.6.23`](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 @@ -73,20 +73,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.22'
pod 'AffiseAttributionLib', '~> 1.6.23'
# Affise modules
pod 'AffiseModule/Advertising', '~> 1.6.22'
pod 'AffiseModule/Status', '~> 1.6.22'
pod 'AffiseModule/Advertising', '~> 1.6.23'
pod 'AffiseModule/Status', '~> 1.6.23'
```

Get source directly from GitHub

```ruby
# Affise SDK library
pod 'AffiseAttributionLib', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.22'
pod 'AffiseAttributionLib', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.23'
# Affise modules
pod 'AffiseModule/Advertising', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.22'
pod 'AffiseModule/Status', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.22'
pod 'AffiseModule/Advertising', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.23'
pod 'AffiseModule/Status', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.23'
```

### Integrate as Swift Package Manager
Expand Down Expand Up @@ -188,8 +188,8 @@ Affise
| Module | Version | Start |
| ------------- |:------------------------------------------------------------------------------------:|----------|
| `Advertising` | [`1.6.22`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Manual` |
| `Status` | [`1.6.22`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto` |
| `Advertising` | [`1.6.23`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Manual` |
| `Status` | [`1.6.23`](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 @@ -241,14 +241,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.22'
pod 'AffiseSKAdNetwork', '~> 1.6.23'
```

Get source directly from GitHub

```ruby
# Wrapper for StoreKit Ad Network
pod 'AffiseSKAdNetwork', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.22'
pod 'AffiseSKAdNetwork', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.23'
```

For `swift` use:
Expand Down
2 changes: 1 addition & 1 deletion example/app-obj-c/Podfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '9.0'
platform :ios, '10.0'
inhibit_all_warnings!
use_frameworks!
workspace 'app-obj-c'
Expand Down
2 changes: 1 addition & 1 deletion example/app/Podfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '9.0'
platform :ios, '10.0'
inhibit_all_warnings!
use_frameworks!
workspace 'app'
Expand Down
4 changes: 2 additions & 2 deletions example/app/app.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -499,7 +499,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
Expand Down

0 comments on commit 800f873

Please sign in to comment.