Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mt 1480 - Moments API #334

Merged
merged 36 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b0151db
initial commit
craigrouse Apr 17, 2024
cb1b994
initial commit of moments api
craigrouse Apr 25, 2024
8e241d0
small fix
craigrouse Apr 25, 2024
5e99e94
WIP
craigrouse Apr 26, 2024
869e547
Added tests
craigrouse Apr 30, 2024
c327ab2
Added tests
craigrouse May 1, 2024
b886e5e
WIP
craigrouse May 31, 2024
bd6cf36
switched to new engine response format
craigrouse May 31, 2024
b69617b
swiftlint changes
craigrouse Jun 14, 2024
4ae6400
accepted recommended project changes
craigrouse Jun 14, 2024
d12a2e8
swiftlint updates
craigrouse Jun 14, 2024
76696e8
sample updates
craigrouse Jun 14, 2024
87b991d
updated consent expiry
craigrouse Jun 17, 2024
27c0100
fix conflict
craigrouse Jun 17, 2024
3aa3d9a
updated test schemes
craigrouse Jun 17, 2024
fd2143c
updated imports
craigrouse Jun 18, 2024
66d76fa
updated tvos scheme
craigrouse Jun 18, 2024
c73aa61
Updated surfile
craigrouse Jun 18, 2024
a25c186
Updates from PR review
craigrouse Jul 15, 2024
2f9c4d4
Added input field for moments API engine ID
craigrouse Jul 16, 2024
932bc39
bumped ruby version
craigrouse Jul 16, 2024
0a96ac6
Further code review updates
craigrouse Jul 16, 2024
62213d5
Switched to using MockURLSession from core
craigrouse Jul 16, 2024
78cf340
Handled missing/null responses from Moments API
craigrouse Jul 17, 2024
a165d61
Made properties optional to align with visitor profile. Skipped null …
craigrouse Jul 17, 2024
d5325db
Updated referrer spelling, added package.swift and podspec
craigrouse Aug 2, 2024
cdf0a41
fix test build issue
craigrouse Aug 2, 2024
729c0cb
updated test.yml
craigrouse Aug 2, 2024
0b507b0
Updated project and fastlane config
craigrouse Aug 2, 2024
9f6119e
removed destination from test.yml
craigrouse Aug 2, 2024
b4d17c5
re-added macOS test scheme
craigrouse Aug 6, 2024
3cb3101
updated test yaml
craigrouse Aug 6, 2024
72cac8a
fixed tests.yaml
craigrouse Aug 6, 2024
39581b4
fixed tests.yaml
craigrouse Aug 6, 2024
52fc69e
changed simulator destination
craigrouse Aug 7, 2024
b4bf9b1
changed simulator destination for UI tests
craigrouse Aug 7, 2024
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
25 changes: 14 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
ruby-version: '3.0'
- name: Install Fastlane
run: |
gem install fastlane
Expand All @@ -24,7 +24,7 @@ jobs:
working-directory: ./builder
strategy:
matrix:
destination: ["platform=iOS Simulator,OS=14.5,name=iPhone 14"]
destination: ["platform=iOS Simulator,OS=17.5,name=iPhone 15 Pro"]
scheme:
- TealiumAppDelegateProxyTests-iOS
- TealiumAttributionTests-iOS
Expand All @@ -40,14 +40,15 @@ jobs:
- TealiumTagManagementIntegrationTests-iOS
- TealiumTagManagementTests-iOS
- TealiumVisitorServiceTests-iOS
- TealiumMomentsAPITests-iOS
steps:
- name: Setup Xcode version
uses: maxim-lobanov/[email protected]
with:
xcode-version: latest-stable
- uses: actions/checkout@v2
- name: Test - "${{ matrix.scheme }}"
run: fastlane scan --scheme "${{ matrix.scheme }}" --output_files "${{ matrix.scheme }}".html
run: fastlane scan --scheme "${{ matrix.scheme }}" --output_files "${{ matrix.scheme }}" --derived-data-path "./build" --skip_build true --result_bundle true --output_types junit --xcodebuild_formatter "xcbeautify -q --is-ci" --destination "${{ matrix.destination }}"
working-directory: ${{env.working-directory}}
- name: Archive Code Coverage Report
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -86,22 +87,23 @@ jobs:
working-directory: ./builder
strategy:
matrix:
destination: ["platform=macOS,arch=x86_64"]
destination: ["platform=macOS"]
scheme:
- TealiumAutotrackingTests-macOS
- TealiumCoreTests-macOS
- TealiumCollectTests-macOS
- TealiumLifecycleTests-macOS
- TealiumMediaTests-macOS
- TealiumVisitorServiceTests-macOS
- TealiumMomentsAPITests-macOS
steps:
- name: Setup Xcode version
uses: maxim-lobanov/[email protected]
with:
xcode-version: latest-stable
- uses: actions/checkout@v2
- name: Test - "${{ matrix.scheme }}"
run: rm -rf output && fastlane scan --scheme "${{ matrix.scheme }}" --derived_data_path ./output --code_coverage true --skip_build true
run: rm -rf output && fastlane scan --scheme "${{ matrix.scheme }}" --derived_data_path ./output --code_coverage true --skip_build true --destination "${{ matrix.destination }}"
working-directory: ${{env.working-directory}}
- name: Archive Code Coverage Report
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -147,14 +149,15 @@ jobs:
- TealiumLifecycleTests-tvOS
- TealiumMediaTests-tvOS
- TealiumVisitorServiceTests-tvOS
- TealiumMomentsAPITests-tvOS
steps:
- name: Setup Xcode version
uses: maxim-lobanov/[email protected]
with:
xcode-version: latest-stable
- uses: actions/checkout@v2
- name: Test - "${{ matrix.scheme }}"
run: rm -rf output && fastlane scan --scheme "${{ matrix.scheme }}" --derived_data_path ./output --code_coverage true --skip_build true
run: rm -rf output && fastlane scan --scheme "${{ matrix.scheme }}" --derived_data_path ./output --code_coverage true --skip_build true --destination "${{ matrix.destination }}"
working-directory: ${{env.working-directory}}
- name: Archive Code Coverage Report
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -206,15 +209,15 @@ jobs:
working-directory: ./builder
strategy:
matrix:
destination: ["platform=iOS Simulator,OS=14.5,name=iPhone 14"]
destination: ["platform=iOS Simulator,OS=17.5,name=iPhone 15 Pro"]
steps:
- name: Setup Xcode version
uses: maxim-lobanov/[email protected]
with:
xcode-version: latest-stable
- uses: actions/checkout@v2
- name: Test TealiumAutotracking iOS UI Tests
run: rm -rf output && fastlane scan --scheme "TealiumAutotrackingUITests-iOS" --derived_data_path ./output --code_coverage false --skip_build true
run: rm -rf output && fastlane scan --scheme "TealiumAutotrackingUITests-iOS" --derived_data_path ./output --code_coverage false --skip_build true --destination "${{ matrix.destination }}"
working-directory: ${{ env.working-directory }}
test_Autotracking_macOS_uiTests:
needs: install
Expand All @@ -226,15 +229,15 @@ jobs:
working-directory: ./builder
strategy:
matrix:
destination: ["platform=macOS,arch=x86_64"]
destination: ["platform=macOS"]
steps:
- name: Setup Xcode version
uses: maxim-lobanov/[email protected]
with:
xcode-version: latest-stable
- uses: actions/checkout@v2
- name: Test TealiumAutotracking macOS UI Tests
run: rm -rf output && fastlane scan --scheme "TealiumAutotrackingUITests-macOS" --derived_data_path ./output --code_coverage false --skip_build true
run: rm -rf output && fastlane scan --scheme "TealiumAutotrackingUITests-macOS" --derived_data_path ./output --code_coverage false --skip_build true --destination "${{ matrix.destination }}"
working-directory: ${{ env.working-directory }}
test_Autotracking_tvOS_uiTests:
needs: install
Expand All @@ -254,5 +257,5 @@ jobs:
xcode-version: latest-stable
- uses: actions/checkout@v2
- name: Test TealiumAutotracking tvOS UI Tests
run: rm -rf output && fastlane scan --scheme "TealiumAutotrackingUITests-tvOS" --derived_data_path ./output --code_coverage false --skip_build true
run: rm -rf output && fastlane scan --scheme "TealiumAutotrackingUITests-tvOS" --derived_data_path ./output --code_coverage false --skip_build true --destination "${{ matrix.destination }}"
working-directory: ${{ env.working-directory }}
1 change: 0 additions & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ file_length:
identifier_name:
excluded:
- id
severity: warning
line_length:
warning: 200
error: 500
Expand Down
11 changes: 10 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ let package = Package(
targets: ["TealiumTagManagement"]),
.library(
name: "TealiumVisitorService",
targets: ["TealiumVisitorService"])
targets: ["TealiumVisitorService"]),
.library(
name: "TealiumMomentsAPI",
targets: ["TealiumMomentsAPI"])

],
dependencies: [
Expand Down Expand Up @@ -124,5 +127,11 @@ let package = Package(
path: "tealium/collectors/visitorservice/",
swiftSettings: [.define("visitorservice")]
),
.target(
name: "TealiumMomentsAPI",
dependencies: ["TealiumCore"],
path: "tealium/collectors/momentsapi/",
swiftSettings: [.define("momentsapi")]
),
]
)
73 changes: 72 additions & 1 deletion builder/SM/Surfile
Original file line number Diff line number Diff line change
Expand Up @@ -627,10 +627,81 @@
</dict>
</array>
</dict>
<dict>
<key>name</key>
<string>TealiumMomentsAPI</string>
<key>targets</key>
<array>
<dict>
<key>sdk</key>
<string>iOS</string>
<key>workspace</key>
<string>tealium-swift.xcworkspace</string>
<key>scheme</key>
<string>TealiumMomentsAPI</string>
</dict>
<dict>
<key>sdk</key>
<string>iOSSimulator</string>
<key>workspace</key>
<string>tealium-swift.xcworkspace</string>
<key>scheme</key>
<string>TealiumMomentsAPI</string>
</dict>
<dict>
<key>sdk</key>
<string>watchSimulator</string>
<key>workspace</key>
<string>tealium-swift.xcworkspace</string>
<key>scheme</key>
<string>TealiumMomentsAPI</string>
</dict>
<dict>
<key>sdk</key>
<string>watchOS</string>
<key>workspace</key>
<string>tealium-swift.xcworkspace</string>
<key>scheme</key>
<string>TealiumMomentsAPI</string>
</dict>
<dict>
<key>sdk</key>
<string>macOS</string>
<key>workspace</key>
<string>tealium-swift.xcworkspace</string>
<key>scheme</key>
<string>TealiumMomentsAPI</string>
</dict>
<dict>
<key>sdk</key>
<string>macOSCatalyst</string>
<key>workspace</key>
<string>tealium-swift.xcworkspace</string>
<key>scheme</key>
<string>TealiumMomentsAPI</string>
</dict>
<dict>
<key>sdk</key>
<string>tvOS</string>
<key>workspace</key>
<string>tealium-swift.xcworkspace</string>
<key>scheme</key>
<string>TealiumMomentsAPI</string>
</dict>
<dict>
<key>sdk</key>
<string>tvOSSimulator</string>
<key>workspace</key>
<string>tealium-swift.xcworkspace</string>
<key>scheme</key>
<string>TealiumMomentsAPI</string>
</dict>
</array>
</dict>
</array>
<key>finalActions</key>
<array>
<string>openDirectory</string>
</array>
</dict>
</plist>
</plist>
22 changes: 22 additions & 0 deletions builder/TealiumMoments-Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
14 changes: 14 additions & 0 deletions builder/iOSTealiumTest/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ struct ContentView: View {
@ObservedObject var iapHelper = IAPHelper.shared
@State private var traceId: String = ""
@State private var showAlert = false
@State private var navigateToMoments = false
@State private var navigateToVisitorService = false
@State private var email: String = TealiumHelper.shared.tealium?.dataLayer.all[TealiumDataKey.email] as? String ?? ""
let name = "Main Screen"
// Timed event start
Expand Down Expand Up @@ -152,6 +154,18 @@ struct ContentView: View {
TealiumTextButton(title: "VisitorProfileRequest") {
TealiumHelper.shared.tealium?.visitorService?.requestVisitorProfile()
}
TealiumTextButton(title: "Moments API") {
navigateToMoments = true
}
TealiumTextButton(title: "Visitor Service") {
navigateToVisitorService = true
}
NavigationLink(destination: MomentsView(), isActive: $navigateToMoments) {
EmptyView()
}
NavigationLink(destination: VisitorServiceView(), isActive: $navigateToVisitorService) {
EmptyView()
}
}
Spacer()
}
Expand Down
7 changes: 7 additions & 0 deletions builder/iOSTealiumTest/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,15 @@
<array>
<string>Intent</string>
</array>
<key>LSApplicationCategoryType</key>
<string></string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
Enricoza marked this conversation as resolved.
Show resolved Hide resolved
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>We'd like to access your location</string>
<key>NSLocationAlwaysUsageDescription</key>
Expand Down
Loading
Loading