Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .github/workflows/test-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,11 @@ jobs:
- name: Run UID2 unit tests on tvOS
run: xcodebuild test -scheme UID2 -destination "OS=18.5,name=Apple TV"

- name: Bootstrap Prebid Dependencies
run: cd UID2Prebid && ./bootstrap.sh && cd -

- name: Build UID2Prebid for iOS
run: xcodebuild -workspace UID2Prebid/UID2Prebid.xcworkspace -scheme UID2Prebid -destination "generic/platform=iOS"
run: xcodebuild -scheme UID2Prebid -destination "generic/platform=iOS"

- name: Run UID2Prebid unit tests
run: xcodebuild test -workspace UID2Prebid/UID2Prebid.xcworkspace -scheme UID2Prebid -destination "OS=18.5,name=iPhone 16"
run: xcodebuild test -scheme UID2Prebid -destination "OS=18.5,name=iPhone 16"

- name: Lint UID2 pod spec
run: pod lib lint UID2.podspec.json --verbose
Expand Down
105 changes: 105 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/UID2Prebid.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "UID2Prebid"
BuildableName = "UID2Prebid"
BlueprintName = "UID2Prebid"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "UID2PrebidTests"
BuildableName = "UID2PrebidTests"
BlueprintName = "UID2PrebidTests"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "UID2"
BuildableName = "UID2"
BlueprintName = "UID2"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "UID2PrebidTests"
BuildableName = "UID2PrebidTests"
BlueprintName = "UID2PrebidTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "UID2Prebid"
BuildableName = "UID2Prebid"
BlueprintName = "UID2Prebid"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
36 changes: 36 additions & 0 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ let package = Package(
.library(
name: "UID2",
targets: ["UID2"]),
.library(
name: "UID2Prebid",
targets: ["UID2Prebid"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-asn1.git", .upToNextMajor(from: "1.0.0")),
.package(url: "https://github.com/prebid/prebid-mobile-ios.git", .upToNextMajor(from: "3.1.0")),
],
targets: [
.target(
Expand All @@ -31,10 +35,27 @@ let package = Package(
.enableExperimentalFeature("StrictConcurrency")
]
),
.target(
name: "UID2Prebid",
dependencies: [
"UID2",
.product(name: "PrebidMobile", package: "prebid-mobile-ios")
],
resources: [
.copy("PrivacyInfo.xcprivacy")
],
swiftSettings: [
.enableExperimentalFeature("StrictConcurrency")
]
),
.testTarget(
name: "UID2Tests",
dependencies: ["UID2", "TestHelpers"]
),
.testTarget(
name: "UID2PrebidTests",
dependencies: ["UID2Prebid"]
),
.target(
name: "TestHelpers",
dependencies: ["UID2"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Foundation
@preconcurrency import PrebidMobile
import UID2

@available(iOS 13, tvOS 13, *)
protocol UserIDUpdater: Sendable {
func updateUserIDs(_ userIDs: [ExternalUserId]) async
}
Expand All @@ -14,7 +15,8 @@ struct PrebidUserIDUpdater: UserIDUpdater {
}
}

public actor UID2Prebid: Sendable {
@available(iOS 13, tvOS 13, *)
public actor UID2Prebid {
let thirdPartyUserIDs: @Sendable () async -> [ExternalUserId]
let userIDUpdater: UserIDUpdater

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ final class UID2PrebidTests: XCTestCase {
)
await observation(
of: [
ExternalUserId(source: "uidapi.com", uids: [.init(id: "cat", aType: 1)])
ExternalUserId(source: "uidapi.com", uids: [.init(id: "cat", aType: 3)])
],
by: updater
)
Expand All @@ -68,7 +68,7 @@ final class UID2PrebidTests: XCTestCase {
)
await observation(
of: [
ExternalUserId(source: "uidapi.com", uids: [.init(id: "turtle", aType: 1)])
ExternalUserId(source: "uidapi.com", uids: [.init(id: "turtle", aType: 3)])
],
by: updater
)
Expand All @@ -93,7 +93,7 @@ final class UID2PrebidTests: XCTestCase {
manager: manager,
thirdPartyUserIDs: {
[
ExternalUserId(source: "example.com", uids: [.init(id: "dog", aType: 1)])
ExternalUserId(source: "example.com", uids: [.init(id: "dog", aType: 3)])
]
},
userIDUpdater: updater,
Expand All @@ -106,16 +106,16 @@ final class UID2PrebidTests: XCTestCase {
)
await observation(
of: [
ExternalUserId(source: "example.com", uids: [.init(id: "dog", aType: 1)]),
ExternalUserId(source: "uidapi.com", uids: [.init(id: "cat", aType: 1)]),
ExternalUserId(source: "example.com", uids: [.init(id: "dog", aType: 3)]),
ExternalUserId(source: "uidapi.com", uids: [.init(id: "cat", aType: 3)]),
],
by: updater
)

continuation.yield(.invalid)
await observation(
of: [
ExternalUserId(source: "example.com", uids: [.init(id: "dog", aType: 1)]),
ExternalUserId(source: "example.com", uids: [.init(id: "dog", aType: 3)]),
],
by: updater
)
Expand Down Expand Up @@ -145,13 +145,19 @@ extension UID2PrebidTests {
}
struct ExternalUserIdEquatable: Equatable {
var source: String
var identifier: String?
var atype: Int?
var uids: [UserUniqueIDEquatable] = []

init(_ userId: ExternalUserId) {
self.source = userId.source
self.identifier = userId.identifier
self.atype = userId.atype?.intValue
self.uids = userId.uids.map(UserUniqueIDEquatable.init)
}
}
struct UserUniqueIDEquatable: Equatable {
var id: String
var aType: Int
init(_ userId: UserUniqueID) {
self.id = userId.id
self.aType = userId.aType.intValue
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions UID2Prebid.podspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
"frameworks": "Foundation",
"resource_bundles": {
"UID2Prebid": [
"UID2Prebid/UID2Prebid/PrivacyInfo.xcprivacy"
"Sources/UID2Prebid/PrivacyInfo.xcprivacy"
]
},
"source_files": [
"UID2Prebid/UID2Prebid/**/*.swift"
"Sources/UID2Prebid/**/*.swift"
],
"dependencies": {
"UID2": [
"~> 1.3.0"
],
"PrebidMobile": [
"~> 2.4"
"~> 3.1"
]
}
}
13 changes: 0 additions & 13 deletions UID2Prebid/Podfile

This file was deleted.

18 changes: 0 additions & 18 deletions UID2Prebid/Podfile.lock

This file was deleted.

12 changes: 0 additions & 12 deletions UID2Prebid/README.md

This file was deleted.

4 changes: 0 additions & 4 deletions UID2Prebid/bootstrap.sh

This file was deleted.