Skip to content

Commit

Permalink
1.6.16
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Korney committed Nov 24, 2023
1 parent 93daa0f commit 5d78d56
Show file tree
Hide file tree
Showing 190 changed files with 674 additions and 308 deletions.
47 changes: 26 additions & 21 deletions .github/workflows/publish.yml → .github/workflows/cocoapods.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
name: Publish
run-name: Publish ${{ github.ref_name }}
name: Publish CocoaPods
run-name: Publish CocoaPods ${{ github.ref_name }}

on:
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
inputs:
version:
description: 'Version build'
required: false
type: string

jobs:
publish:
Expand All @@ -15,10 +21,22 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

# Version
- name: Version Tag
id: version_tag
run: |
if [ -n "${{ inputs.version }}" ]; then
echo Version: ${{ inputs.version }}
echo "VERSION=${{ inputs.version }}" >> "$GITHUB_OUTPUT"
else
echo Version: ${{ github.ref_name }}
echo "VERSION=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
fi
- name: Info
if: ${{ success() || failure() }}
env:
LIB_VERSION: ${{ github.ref_name }}
LIB_VERSION: ${{ steps.version_tag.outputs.VERSION }}
run: |
pod --version
pod ipc spec AffiseAttributionLib.podspec
Expand All @@ -31,7 +49,7 @@ jobs:
if: ${{ success() || failure() }}
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
LIB_VERSION: ${{ github.ref_name }}
LIB_VERSION: ${{ steps.version_tag.outputs.VERSION }}
run: |
pod trunk push AffiseAttributionLib.podspec --allow-warnings
Expand All @@ -41,7 +59,7 @@ jobs:
id: skad
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
LIB_VERSION: ${{ github.ref_name }}
LIB_VERSION: ${{ steps.version_tag.outputs.VERSION }}
run: |
pod trunk push AffiseSKAdNetwork.podspec --allow-warnings
Expand All @@ -51,7 +69,7 @@ jobs:
id: internal
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
LIB_VERSION: ${{ github.ref_name }}
LIB_VERSION: ${{ steps.version_tag.outputs.VERSION }}
run: |
pod trunk push AffiseInternal.podspec --allow-warnings --synchronous
Expand All @@ -61,19 +79,6 @@ jobs:
id: module
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
LIB_VERSION: ${{ github.ref_name }}
LIB_VERSION: ${{ steps.version_tag.outputs.VERSION }}
run: |
pod trunk push AffiseModule.podspec --allow-warnings --synchronous
# Release
- name: Release
if: ${{ success() || failure() }}
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Affise Attribution iOS SDK ${{ github.ref }}
draft: false
prerelease: false
93 changes: 93 additions & 0 deletions .github/workflows/framework.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Publish Frameworks
run-name: Publish Frameworks ${{ github.ref_name }}

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
inputs:
version:
description: 'Version build'
required: false
type: string

jobs:
publish:
name: Publish Affise SDK Frameworks
runs-on: macOS-latest

steps:
- name: Checkout
uses: actions/checkout@v3

# Version
- name: Version Tag
id: version_tag
run: |
if [ -n "${{ inputs.version }}" ]; then
echo Version: ${{ inputs.version }}
echo "VERSION=${{ inputs.version }}" >> "$GITHUB_OUTPUT"
else
echo Version: ${{ github.ref_name }}
echo "VERSION=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
fi
- name: Setup Swift 5.7
uses: swift-actions/setup-swift@v1
with:
swift-version: "5.7"

- name: Create AffiseAttributionLib XCFramework
uses: unsignedapps/swift-create-xcframework@v2.3.0
with:
target: "AffiseAttributionLib"

# Release
- name: Release
if: ${{ success() }}
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Affise Attribution iOS SDK ${{ steps.version_tag.outputs.VERSION }}
draft: false
prerelease: false

# Upload AffiseAttributionLib
- name: Upload Release AffiseAttributionLib Framework 🗳
if: ${{ success() }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./AffiseAttributionLib.zip
asset_name: AffiseAttributionLib-${{ steps.version_tag.outputs.VERSION }}.xcframework.zip
asset_content_type: application/zip

# # Upload AffiseModuleStatus
# - name: Upload Release AffiseModuleStatus Framework 🗳
# if: ${{ success() }}
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./AffiseModuleStatus.zip
# asset_name: AffiseModuleStatus-${{ steps.version_tag.outputs.VERSION }}.xcframework.zip
# asset_content_type: application/zip

# # Upload AffiseSKAdNetwork
# - name: Upload Release AffiseSKAdNetwork Framework 🗳
# if: ${{ success() }}
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./AffiseSKAdNetwork.zip
# asset_name: AffiseSKAdNetwork-${{ steps.version_tag.outputs.VERSION }}.xcframework.zip
# asset_content_type: application/zip
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ DerivedData/
# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "build"

build/

.build

#####
# Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups)
Expand Down Expand Up @@ -141,6 +141,9 @@ IDEWorkspaceChecks.plist
*.xcodeproj
!example/*.xcodeproj


*.xcframework/

# Miscellaneous
*.class
*.log
Expand Down
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.15"
spec.version = ENV['LIB_VERSION'] || "1.6.16"
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
6 changes: 3 additions & 3 deletions AffiseAttributionLib/Classes/Affise.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Foundation
import WebKit

/**
* Entry point to initialise Affise Attribution library
*/
import WebKit


@objc
public final class Affise: NSObject {

Expand Down
2 changes: 2 additions & 0 deletions AffiseAttributionLib/Classes/AffiseApi.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Foundation

internal protocol AffiseApi {
var firstAppOpenUseCase: FirstAppOpenUseCase {get}
var sessionManager: SessionManager {get}
Expand Down
4 changes: 4 additions & 0 deletions AffiseAttributionLib/Classes/AffiseComponent.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import Foundation
import UIKit


internal class AffiseComponent: AffiseApi {

private let app: UIApplication
Expand Down
1 change: 1 addition & 0 deletions AffiseAttributionLib/Classes/AffiseShared.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Foundation
import WebKit


Expand Down
12 changes: 7 additions & 5 deletions AffiseAttributionLib/Classes/ad/AffiseAdRevenue.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Foundation

@objc
public final class AffiseAdRevenue: NSObject {

Expand All @@ -9,34 +11,34 @@ public final class AffiseAdRevenue: NSObject {
}

public func setRevenue(_ revenue: Float, _ currency: String) -> AffiseAdRevenue {
let _ = event
_ = event
.addPredefinedParameter(.REVENUE, float: revenue)
.addPredefinedParameter(.CURRENCY, string: currency)
return self
}

public func setRevenue(_ revenue: Double, _ currency: String) -> AffiseAdRevenue {
let _ = event
_ = event
.addPredefinedParameter(.REVENUE, float: Float(revenue))
.addPredefinedParameter(.CURRENCY, string: currency)
return self
}

public func setNetwork(_ network: String?) -> AffiseAdRevenue {
guard let value = network else { return self }
let _ = event.addPredefinedParameter(.NETWORK, string: value)
_ = event.addPredefinedParameter(.NETWORK, string: value)
return self
}

public func setUnit(_ unit: String?) -> AffiseAdRevenue {
guard let value = unit else { return self }
let _ = event.addPredefinedParameter(.UNIT, string: value)
_ = event.addPredefinedParameter(.UNIT, string: value)
return self
}

public func setPlacement(_ placement: String?) -> AffiseAdRevenue {
guard let value = placement else { return self }
let _ = event.addPredefinedParameter(.PLACEMENT, string: value)
_ = event.addPredefinedParameter(.PLACEMENT, string: value)
return self
}

Expand Down
2 changes: 2 additions & 0 deletions AffiseAttributionLib/Classes/ad/AffiseAdSource.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Foundation

@objc
public enum AffiseAdSource: Int {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
//
// AdvertisingIdManagerImpl.swift
// AffiseAttributionLib
//
// Created by Sergey Korney
//

import AdSupport
import AppTrackingTransparency

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
//
// AppLifecycleEventsManagerImpl.swift
// AffiseAttributionLib
//
// Created by Sergey Korney
//
import Foundation
import UIKit

/**
* Manager for handling events occurring on the activity
*
* @property app application on which they are listening Activities
* @property logsManager for error logging
*/


class AppLifecycleEventsManagerImpl {
private let notificationCenter: NotificationCenter
private let logsManager: LogsManager
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
//
// ConverterToBase64.swift
// app
//
// Created by Sergey Korney
//

import Foundation

/**
* Convert string to Base64 [encoded string]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
//
// EventToSerializedEventConverter.swift
// app
//
// Created by Sergey Korney
//
import Foundation


/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
//
// InstallReferrerToDeeplinkUriConverter.swift
// AffiseAttributionLib
//
// Created by Sergey Korney
//

import Foundation

/**
* Implementation of [Converter]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
//
// LogToSerializedLogConverter.swift
// AffiseAttributionLib
//
// Created by Sergey Korney
//

import Foundation

/**
* Converter AffiseLog to SerializedLog
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Foundation

public class StringToKeyValueConverter: Converter {

private static let KEY = "key"
Expand All @@ -13,7 +15,8 @@ public class StringToKeyValueConverter: Converter {
var result: [AffiseKeyValue] = []

do {
let jsonArray = try JSONSerialization.jsonObject(with: json.data(using: .utf8)!, options: .mutableContainers) as! [[String:Any?]]
let jsonArray = try JSONSerialization.jsonObject(with: json.data(using: .utf8)!, options: .mutableContainers) as? [[String:Any?]]
guard let jsonArray = jsonArray else { return result }
for item in jsonArray {
guard let key = item[StringToKeyValueConverter.KEY] as? String else { continue }
let value = item[StringToKeyValueConverter.VALUE] as? String
Expand Down
Loading

0 comments on commit 5d78d56

Please sign in to comment.