Skip to content

Commit

Permalink
1.6.22
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Korney committed Jan 16, 2024
1 parent 31ae1f7 commit ea6a390
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 35 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.21"
spec.version = ENV['LIB_VERSION'] || "1.6.22"
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
54 changes: 38 additions & 16 deletions AffiseAttributionLib/Classes/events/EventsManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,29 +71,37 @@ class EventsManager {
* Start timer fo repeat send events
*/
private func startTimer() {
//Stop timer if running
stopTimer()

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

DispatchQueue.main.async {
RunLoop.current.add(self.timer!, forMode: .common)
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 fo repeat send events
*/
private func stopTimer() {
if timer == nil { return }
//Stop timer
timer?.invalidate()
timer = nil
lockQueue.async(flags: .barrier) {
if self.timer == nil { return }
self.timer?.invalidate()
self.timer = nil
}
}

@objc
Expand All @@ -104,4 +112,18 @@ class EventsManager {
//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.21"
return "1.6.22"
}

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.21"
spec.version = ENV['LIB_VERSION'] || "1.6.22"
spec.summary = "Affise Internal library"
spec.description = "Affise Internal wrapper library for crossplatform"
spec.homepage = "https://github.com/affise/sdk-ios"
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.21"
s.version = ENV["LIB_VERSION"] || "1.6.22"
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.21"
spec.version = ENV['LIB_VERSION'] || "1.6.22"
spec.summary = "AffiseSKAdNetwork iOS library"
spec.description = "Affise library for StoreKit Ad Network (SKAdNetwork)"
spec.homepage = "https://github.com/affise/sdk-ios"
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.21`](https://github.com/CocoaPods/Specs/tree/master/Specs/a/9/3/AffiseAttributionLib) |
| `AffiseSKAdNetwork` | [`1.6.21`](https://github.com/CocoaPods/Specs/tree/master/Specs/3/6/f/AffiseSKAdNetwork) |
| `AffiseModule/Advertising` | [`1.6.21`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) |
| `AffiseModule/Status` | [`1.6.21`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) |
| `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/) |

- [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.21'
pod 'AffiseAttributionLib', '~> 1.6.22'
# Affise modules
pod 'AffiseModule/Advertising', '~> 1.6.21'
pod 'AffiseModule/Status', '~> 1.6.21'
pod 'AffiseModule/Advertising', '~> 1.6.22'
pod 'AffiseModule/Status', '~> 1.6.22'
```

Get source directly from GitHub

```ruby
# Affise SDK library
pod 'AffiseAttributionLib', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.21'
pod 'AffiseAttributionLib', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.22'
# Affise modules
pod 'AffiseModule/Advertising', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.21'
pod 'AffiseModule/Status', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.21'
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'
```

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

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.21'
pod 'AffiseSKAdNetwork', '~> 1.6.22'
```

Get source directly from GitHub

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

For `swift` use:
Expand Down

0 comments on commit ea6a390

Please sign in to comment.