Skip to content

Commit

Permalink
1.6.27
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Korney committed Mar 12, 2024
1 parent ef57381 commit f2d0c52
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 19 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.26"
spec.version = ENV['LIB_VERSION'] || "1.6.27"
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
7 changes: 7 additions & 0 deletions AffiseAttributionLib/Classes/Affise.swift
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@ public final class Affise: NSObject {
public static func getProviders() -> [ProviderType:Any?] {
return api?.postBackModelFactory.getProvidersMap().toMap() ?? [:]
}

/**
* Is it first run
*/
public static func isFirstRun() -> Bool {
return api?.firstAppOpenUseCase.isFirstRun() ?? true
}

/**
* Get module status
Expand Down
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.26"
return "1.6.27"
}

public override func getOrder() -> Float {
Expand Down
11 changes: 11 additions & 0 deletions AffiseAttributionLib/Classes/usecase/FirstAppOpenUseCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ internal class FirstAppOpenUseCase {
private let AFF_ALT_DEVICE_ID = "AFF_ALT_DEVICE_ID"

private let preferences: UserDefaults
private var firstRun: Bool = false

init(preferences: UserDefaults) {
self.preferences = preferences
Expand All @@ -21,6 +22,8 @@ internal class FirstAppOpenUseCase {
if (preferences.value(forKey: FIRST_OPENED_DATE_KEY) == nil) {
onAppFirstOpen()
}

firstRun = preferences.value(forKey: FIRST_OPENED) as? Bool ?? true
}

/**
Expand Down Expand Up @@ -63,6 +66,14 @@ internal class FirstAppOpenUseCase {
return value
}

/**
* Get first run
* @return is first run
*/
func isFirstRun() -> Bool {
return firstRun
}

/**
* Get first open date
* @return first open date
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.26"
spec.version = ENV['LIB_VERSION'] || "1.6.27"
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: 2 additions & 0 deletions AffiseInternal/Classes/AffiseApiMethod.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public enum AffiseApiMethod: Int {
case GET_PROVIDERS
case MODULE_START
case GET_MODULES_INSTALLED
case IS_FIRST_RUN
// callback
case GET_REFERRER_CALLBACK
case GET_REFERRER_VALUE_CALLBACK
Expand Down Expand Up @@ -63,6 +64,7 @@ public enum AffiseApiMethod: Int {
case .GET_PROVIDERS: return "get_providers"
case .MODULE_START: return "module_start"
case .GET_MODULES_INSTALLED: return "get_modules_installed"
case .IS_FIRST_RUN: return "is_first_run"
// callback
case .GET_REFERRER_CALLBACK: return "get_referrer_callback"
case .GET_REFERRER_VALUE_CALLBACK: return "get_referrer_value_callback"
Expand Down
5 changes: 5 additions & 0 deletions AffiseInternal/Classes/AffiseApiWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public class AffiseApiWrapper: NSObject {
case .GET_PROVIDERS: callGetProviders(api, map: map, result: result)
case .MODULE_START: callModuleStart(api, map: map, result: result)
case .GET_MODULES_INSTALLED: callGetModulesInstalled(api, map: map, result: result)
case .IS_FIRST_RUN: callIsFirstRun(api, map: map, result: result)
case .GET_REFERRER_CALLBACK: callGetReferrer(api, map: map, result: result)
case .GET_REFERRER_VALUE_CALLBACK: callGetReferrerValue(api, map: map, result: result)
case .GET_STATUS_CALLBACK: callGetStatusCallback(api, map: map, result: result)
Expand Down Expand Up @@ -276,6 +277,10 @@ public class AffiseApiWrapper: NSObject {
result?.success(data)
}

private func callIsFirstRun(_ api: AffiseApiMethod, map: [String: Any?], result: AffiseResult?) {
result?.success(Affise.isFirstRun())
}

private func callGetReferrer(_ api: AffiseApiMethod, map: [String: Any?], result: AffiseResult?) {
guard let uuid: String = map.opt(UUID) else {
result?.error("api [\(api.method)]: no valid Callback UUID")
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.26"
s.version = ENV["LIB_VERSION"] || "1.6.27"
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.26"
spec.version = ENV['LIB_VERSION'] || "1.6.27"
spec.summary = "AffiseSKAdNetwork iOS library"
spec.description = "Affise library for StoreKit Ad Network (SKAdNetwork)"
spec.homepage = "https://github.com/affise/sdk-ios"
Expand Down
35 changes: 21 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.26`](https://github.com/CocoaPods/Specs/tree/master/Specs/a/9/3/AffiseAttributionLib) |
| `AffiseSKAdNetwork` | [`1.6.26`](https://github.com/CocoaPods/Specs/tree/master/Specs/3/6/f/AffiseSKAdNetwork) |
| `AffiseModule/Advertising` | [`1.6.26`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) |
| `AffiseModule/Status` | [`1.6.26`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) |
| `AffiseAttributionLib` | [`1.6.27`](https://github.com/CocoaPods/Specs/tree/master/Specs/a/9/3/AffiseAttributionLib) |
| `AffiseSKAdNetwork` | [`1.6.27`](https://github.com/CocoaPods/Specs/tree/master/Specs/3/6/f/AffiseSKAdNetwork) |
| `AffiseModule/Advertising` | [`1.6.27`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) |
| `AffiseModule/Status` | [`1.6.27`](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 @@ -38,6 +38,7 @@
- [Get random user Id](#get-random-user-id)
- [Get random device Id](#get-random-device-id)
- [Get providers](#get-providers)
- [Is first run](#is-first-run)
- [Get referrer](#get-referrer)
- [Get referrer parameter](#get-referrer-parameter)
- [Referrer keys](#referrer-keys)
Expand Down Expand Up @@ -73,20 +74,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.26'
pod 'AffiseAttributionLib', '~> 1.6.27'
# Affise modules
pod 'AffiseModule/Advertising', '~> 1.6.26'
pod 'AffiseModule/Status', '~> 1.6.26'
pod 'AffiseModule/Advertising', '~> 1.6.27'
pod 'AffiseModule/Status', '~> 1.6.27'
```

Get source directly from GitHub

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

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

Get source directly from GitHub

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

For `swift` use:
Expand Down Expand Up @@ -815,6 +816,12 @@ let key = ProviderType.AFFISE_APP_TOKEN
let value = providers[key]
```

## Is first run

```swift
Affise.isFirstRun()
```

## Get referrer

> **Note**
Expand Down

0 comments on commit f2d0c52

Please sign in to comment.