Skip to content

Commit b725a50

Browse files
committed
Add CocoaPods podspec
1 parent e92eeb4 commit b725a50

8 files changed

Lines changed: 38 additions & 86 deletions

File tree

.github/workflows/test-pull-request.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,7 @@ jobs:
2323
run: xcodebuild -scheme UID2 -sdk iphonesimulator16.2 -destination "OS=16.2,name=iPhone 14"
2424

2525
- name: Run unit tests
26-
run: xcodebuild test -scheme UID2Tests -sdk iphonesimulator16.2 -destination "OS=16.2,name=iPhone 14"
26+
run: xcodebuild test -scheme UID2Tests -sdk iphonesimulator16.2 -destination "OS=16.2,name=iPhone 14"
27+
28+
- name: Lint pod spec
29+
run: pod lib lint --verbose

Package.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ let package = Package(
2121
name: "UID2",
2222
dependencies: [],
2323
resources: [
24-
.copy("Properties/sdk_properties.plist"),
2524
.copy("PrivacyInfo.xcprivacy")
2625
]),
2726
.testTarget(

Sources/UID2/Properties/SDKProperties.swift

Lines changed: 0 additions & 18 deletions
This file was deleted.

Sources/UID2/Properties/SDKPropertyLoader.swift

Lines changed: 0 additions & 29 deletions
This file was deleted.

Sources/UID2/Properties/UID2SDKProperties.swift

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,7 @@ import Foundation
1010
public class UID2SDKProperties {
1111

1212
public static func getUID2SDKVersion() -> (major: Int, minor: Int, patch: Int) {
13-
14-
let invalidVersion = (major: 0, minor: 0, patch: 0)
15-
16-
let properties = SDKPropertyLoader.load()
17-
guard let version = properties.uid2Version else {
18-
return invalidVersion
19-
}
20-
21-
let versionComponents = version.components(separatedBy: ".")
22-
23-
if versionComponents.count == 3 {
24-
guard let major = Int(versionComponents[0]),
25-
let minor = Int(versionComponents[1]),
26-
let patch = Int(versionComponents[2]) else {
27-
return invalidVersion
28-
}
29-
return (major: major, minor: minor, patch: patch)
30-
}
31-
32-
return invalidVersion
13+
(0, 3, 0)
3314
}
34-
15+
3516
}

Sources/UID2/Properties/sdk_properties.plist

Lines changed: 0 additions & 8 deletions
This file was deleted.

Sources/UID2/UID2Manager.swift

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,15 @@ public final actor UID2Manager {
5757
private let defaultUid2ApiUrl = "https://prod.uidapi.com"
5858

5959
private init() {
60-
61-
// SDK Supplied Properties
62-
self.sdkVersion = UID2SDKProperties.getUID2SDKVersion()
63-
6460
// App Supplied Properites
6561
var apiUrl = defaultUid2ApiUrl
6662
if let apiUrlOverride = Bundle.main.object(forInfoDictionaryKey: "UID2ApiUrl") as? String, !apiUrlOverride.isEmpty {
6763
apiUrl = apiUrlOverride
6864
}
69-
var clientVersion = "\(sdkVersion.major).\(sdkVersion.minor).\(sdkVersion.patch)"
70-
if self.sdkVersion == (major: 0, minor: 0, patch: 0) {
71-
clientVersion = "unknown"
72-
}
65+
66+
// SDK Supplied Properties
67+
sdkVersion = UID2SDKProperties.getUID2SDKVersion()
68+
let clientVersion = "\(sdkVersion.major).\(sdkVersion.minor).\(sdkVersion.patch)"
7369
uid2Client = UID2Client(uid2APIURL: apiUrl, sdkVersion: clientVersion)
7470

7571
// Try to load from Keychain if available

UID2.podspec.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "UID2",
3+
"summary": "A framework for integrating UID2 into iOS applications.",
4+
"homepage": "https://unifiedid.com/",
5+
"license": "Apache License, Version 2.0",
6+
"version": "0.3.0",
7+
"authors": {
8+
"David Snabel-Caunt": "dave.snabel-caunt@thetradedesk.com"
9+
},
10+
"source": {
11+
"git": "https://github.com/IABTechLab/uid2-ios-sdk.git",
12+
"tag": "v0.3.0"
13+
},
14+
"platforms": {
15+
"ios": "13.0"
16+
},
17+
"swift_versions": [
18+
"5"
19+
],
20+
"requires_arc": true,
21+
"frameworks": "Foundation",
22+
"resource_bundles": {
23+
"UID2": ["Sources/UID2/PrivacyInfo.xcprivacy"]
24+
},
25+
"source_files": [
26+
"Sources/UID2/**/*"
27+
]
28+
}

0 commit comments

Comments
 (0)