Skip to content

Commit

Permalink
1.6.20
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Korney committed Dec 29, 2023
1 parent 8faf3c4 commit 4b6ece9
Show file tree
Hide file tree
Showing 12 changed files with 85 additions and 27 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.19"
spec.version = ENV['LIB_VERSION'] || "1.6.20"
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
20 changes: 18 additions & 2 deletions AffiseAttributionLib/Classes/Affise.swift
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,24 @@ public final class Affise: NSObject {
* Manual module start
*/
@objc
public static func moduleStart(_ module: AffiseModules) {
api?.moduleManager.manualStart(module)
@discardableResult
public static func moduleStart(_ module: AffiseModules) -> Bool {
return api?.moduleManager.manualStart(module) ?? false
}

/**
* Get installed modules
*/
@objc
public static func getModulesInstalledObjc() -> [String] {
return api?.moduleManager.getModules().map { $0.description } ?? []
}

/**
* Get installed modules
*/
public static func getModulesInstalled() -> [AffiseModules] {
return api?.moduleManager.getModules() ?? []
}

/**
Expand Down
11 changes: 8 additions & 3 deletions AffiseAttributionLib/Classes/modules/AffiseModuleManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,15 @@ internal class AffiseModuleManager {
}
}

func manualStart(_ module: AffiseModules) {
guard let affiseModule: AffiseModule = getModule(module) else { return }
if affiseModule.isManual() == false { return }
func getModules() -> [AffiseModules] {
return Array(modules.keys)
}

func manualStart(_ module: AffiseModules) -> Bool {
guard let affiseModule: AffiseModule = getModule(module) else { return false }
if affiseModule.isManual() == false { return false }
moduleStart(affiseModule)
return true
}

func status(_ module: AffiseModules, _ onComplete: @escaping OnKeyValueCallback) {
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.19"
return "1.6.20"
}

public override func getOrder() -> Float {
Expand Down
10 changes: 10 additions & 0 deletions AffiseAttributionLib/Classes/referrer/ReferrerKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ public enum ReferrerKey: Int {
case SUB_3
case SUB_4
case SUB_5
case AFFISE_SUB_1
case AFFISE_SUB_2
case AFFISE_SUB_3
case AFFISE_SUB_4
case AFFISE_SUB_5

var enumValue: String {
switch self {
Expand Down Expand Up @@ -63,6 +68,11 @@ public enum ReferrerKey: Int {
case .SUB_3: return "sub3"
case .SUB_4: return "sub4"
case .SUB_5: return "sub5"
case .AFFISE_SUB_1: return "affise_sub1"
case .AFFISE_SUB_2: return "affise_sub2"
case .AFFISE_SUB_3: return "affise_sub3"
case .AFFISE_SUB_4: return "affise_sub4"
case .AFFISE_SUB_5: return "affise_sub5"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Foundation

class RetrieveInstallReferrerUseCase {

let moduleManager: AffiseModuleManager
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.19"
spec.version = ENV['LIB_VERSION'] || "1.6.20"
spec.summary = "Affise Internal library"
spec.description = "Affise Internal wrapper library for crossplatform"
spec.homepage = "https://github.com/affise/sdk-ios"
Expand Down
3 changes: 3 additions & 0 deletions AffiseInternal/Classes/AffiseApiMethod.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public enum AffiseApiMethod: Int {
case GET_RANDOM_DEVICE_ID
case GET_PROVIDERS
case MODULE_START
case GET_MODULES_INSTALLED
// callback
case GET_REFERRER_CALLBACK
case GET_REFERRER_VALUE_CALLBACK
Expand Down Expand Up @@ -61,6 +62,8 @@ public enum AffiseApiMethod: Int {
case .GET_RANDOM_DEVICE_ID: return "get_random_device_id"
case .GET_PROVIDERS: return "get_providers"
case .MODULE_START: return "module_start"
case .GET_MODULES_INSTALLED: return "get_modules_installed"
// callback
case .GET_REFERRER_CALLBACK: return "get_referrer_callback"
case .GET_REFERRER_VALUE_CALLBACK: return "get_referrer_value_callback"
case .GET_STATUS_CALLBACK: return "get_status_callback"
Expand Down
9 changes: 7 additions & 2 deletions AffiseInternal/Classes/AffiseApiWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public class AffiseApiWrapper: NSObject {
case .GET_RANDOM_DEVICE_ID: callGetRandomDeviceId(api, map: map, result: result)
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 .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 @@ -267,8 +268,12 @@ public class AffiseApiWrapper: NSObject {
return
}

Affise.moduleStart(module)
result?.success(nil)
result?.success(Affise.moduleStart(module))
}

private func callGetModulesInstalled(_ api: AffiseApiMethod, map: [String: Any?], result: AffiseResult?) {
let data: [String] = Affise.getModulesInstalled().map { $0.description }
result?.success(data)
}

private func callGetReferrer(_ api: AffiseApiMethod, map: [String: Any?], result: AffiseResult?) {
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.19"
s.version = ENV["LIB_VERSION"] || "1.6.20"
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.19"
spec.version = ENV['LIB_VERSION'] || "1.6.20"
spec.summary = "AffiseSKAdNetwork iOS library"
spec.description = "Affise library for StoreKit Ad Network (SKAdNetwork)"
spec.homepage = "https://github.com/affise/sdk-ios"
Expand Down
47 changes: 32 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.19`](https://github.com/CocoaPods/Specs/tree/master/Specs/a/9/3/AffiseAttributionLib) |
| `AffiseSKAdNetwork` | [`1.6.19`](https://github.com/CocoaPods/Specs/tree/master/Specs/3/6/f/AffiseSKAdNetwork) |
| `AffiseModule/Advertising` | [`1.6.19`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) |
| `AffiseModule/Status` | [`1.6.19`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) |
| `AffiseAttributionLib` | [`1.6.20`](https://github.com/CocoaPods/Specs/tree/master/Specs/a/9/3/AffiseAttributionLib) |
| `AffiseSKAdNetwork` | [`1.6.20`](https://github.com/CocoaPods/Specs/tree/master/Specs/3/6/f/AffiseSKAdNetwork) |
| `AffiseModule/Advertising` | [`1.6.20`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) |
| `AffiseModule/Status` | [`1.6.20`](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.19'
pod 'AffiseAttributionLib', '~> 1.6.20'
# Affise modules
pod 'AffiseModule/Advertising', '~> 1.6.19'
pod 'AffiseModule/Status', '~> 1.6.19'
pod 'AffiseModule/Advertising', '~> 1.6.20'
pod 'AffiseModule/Status', '~> 1.6.20'
```

Get source directly from GitHub

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

### Integrate as Swift Package Manager
Expand Down Expand Up @@ -178,17 +178,29 @@ Affise

### Modules

> **Warning**
>
> πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯
> How to install modules read in [Integration section](#integration)
> πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯πŸŸ₯
| Module | Version | Start |
| ------------- |:------------------------------------------------------------------------------------:|----------|
| [`Advertising`](#advertising) | [`1.6.19`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Manual` |
| `Status` | [`1.6.19`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto` |
| `Advertising` | [`1.6.20`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Manual` |
| `Status` | [`1.6.20`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto` |

If module start type is `manual`, then call
If module start type is `manual`, then call:

```swift
Affise.moduleStart(.Advertising)
```

Get list of installed modules:

```swift
Affise.getModulesInstalled()
```

#### Advertising

This module required to Use [`IDFA`](https://developer.apple.com/documentation/adsupport/asidentifiermanager/advertisingidentifier) (Identifier for advertisers)
Expand Down Expand Up @@ -227,14 +239,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.19'
pod 'AffiseSKAdNetwork', '~> 1.6.20'
```

Get source directly from GitHub

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

For `swift` use:
Expand Down Expand Up @@ -849,6 +861,11 @@ In examples above `ReferrerKey.CLICK_ID` is used, but many others is available:
- `AFFISE_REF`
- `AFFISE_SITE_ID`
- `AFFISE_SUB_SITE_ID`
- `AFFISE_SUB_1`
- `AFFISE_SUB_2`
- `AFFISE_SUB_3`
- `AFFISE_SUB_4`
- `AFFISE_SUB_5`
- `AFFC`
- `PID`
- `SUB_1`
Expand Down

0 comments on commit 4b6ece9

Please sign in to comment.