Skip to content

Commit

Permalink
2.5.0 (#232)
Browse files Browse the repository at this point in the history
* [MT-813] Scenedelegate fix (#230)

* New logic for TealiumDelegateProxy swizzling

If available we always swizzle the scene delegate, otherwise we fallback on app delegate
We use a plist flag to avoid swizzling altogether

* Split AppDelegateTests from SceneDelegateTests

* Deprecate appDelegateProxyEnabled flag

* Don't remove ALL contexts from the delegateProxy when 1 tealium instance is deallocated

* Add secureMainThreadExecution method and use it where needed

Avoid main thread sync on disable webview to avoid any unnecessary possible risk of deadlocks
Remove completion for sync attachToUIView and setRootView methods
Add tests for disable/deinit TagManagementWKWebView

* [MT-677] Improve rename and reorganize pubsub classes

* Remove autotracking extension tests (no more autotrackingmanager present)

* Add tests for InstanceManager

* Enable building autotracking for all platforms

* Move swiftui autotracking to View extension

* Move onAutoTrackView from TealiumInstanceManager to AutoTrackingModule and make it internal

* Extend View for trackingAppOpenUrl

* Improve TealiumViewTrackable, documentation and sample

* Add autotracking workaround for a bug with onDisappear, fix available checks and add test target for watchOS too

* Add UI tests for autotracking!

* [MT-770] (#223)

* add a UIViewController protocol to ease autotracking for custom view controllers

ViewController that can't be subclassed from TealiumViewController (i.e. UITableViewController subclasses)
just have to conform to TealiumViewControllerTrackable and call trackViewControllerAppearence from their viewDidAppear.

* change info.plist flag that prevents UIViewController swizzling

TealiumAutotrackingViewControllersEnabled better represents that this flag only affects ViewController based autotracking

* Fix swift import from obj-c with cocoapods

* [MT-677] add subscribeOnce to observables

* move autotracking blocklist fetching out of main thread

* improve test reliability and error messages

* change UITests

OnAppear doesn't follow any strict order when nesting views
So we just test 1 autotrack per view instead of multiple tracking

* Version 2.5.0

* [MT-848] try to split objc target with spm

* [MT-848] move objc files into subfolder

* [MT-848] fix core library name

* [MT-848] just include and exclude objc files into targets

* [MT-848] fix objc target path

* [WIP] made it work with test targets

* [MT-848] make it work with TealiumCore

* [WIP] autotracking fixes

* Remove unused bridging header

* Increase iOS pospec's ios version to make it work with SwiftUI

(canImport seems not to work with swiftUI under ios 11)

* [MT-848] Make autotracking available for SPM too

* Add comment on podfile

* Changed all the force unwraps to safley check the values first (#234)

* [MT-821] Improve Codable support (#233)

* [MT-821] make substring codable

* [MT-821] Encoding to nil non-codable objects instead of failing the track call

Now all Dictionaries and Arrays with non-codable objects will replace those objects with NSNull
Assert is added in a block so LLDB doesn't access the `container` variable, causing an internal crash
that would lose the debuggable state.

* [MT-687] Make ConsentManagerModule just a DispatchValidator (#235)

It being a collector wasn't useful, it only added data twice.
Add lastConsentUpdated as a dataLayer key when present.

* [MT-687] Remove another duplicate consent data adding

Move lastConsentUpdated key and other unified keys in the ConsentPolicy

* [MT-687] Improve tests

Remove useless test (it had a return before the useful part)
Add new test for dispatchValidators adding consent data.
Add test on ConsentManagerModule

* [MT-500] Expose data layer variables (#237)

* [MT-500] add gatherTrackData method on Tealium class

* [MT-500] rename most data layer keys TealiumDataKey

* [MT-500] move Core config keys into TealiumConfigKey enum

* [MT-500] fix refreshInterval naming collision

* [MT-500] fix some tests

* [MT-687] fix consent categories not added on update_consent_cookie event

* Add more strict #if for excluding SwiftUI out of armv7 and i386 architectures

* Remove location out of macCatalist too

* Improve podspec exclusion files for all platforms

* Add support for UIKit autotracking on tvOS too

* Add swiftlint to every library target

Add minor improvement on eventual leaks (not happening now due to variable being static)

* Remove lowPowerNotificationObserver to remove a leak

* Fix warnings on TealiumSwiftExample

* [MT-770] Fix Autotracking block behavior

Autotracked views are blocked if a blocked key is contained in the view name

Co-authored-by: craigrouse <[email protected]>
Co-authored-by: christinasund <[email protected]>
Co-authored-by: Craig Rouse <[email protected]>
Co-authored-by: Tyler Rister <[email protected]>
  • Loading branch information
5 people authored Nov 18, 2021
1 parent b4ab44f commit 7d86521
Show file tree
Hide file tree
Showing 124 changed files with 1,755 additions and 1,140 deletions.
4 changes: 2 additions & 2 deletions builder/AutoTrackingIOSTest/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct ContentView: View {
List {
NavigationLink("Launch ViewController", destination:
TealiumViewTrackable {
#if os(iOS)
#if os(iOS) || os(tvOS)
ViewControllerWrapper()
#else
SomeView()
Expand All @@ -46,7 +46,7 @@ struct ContentView: View {
NavigationLink("Launch Third View", destination:
AutotrackingView()
)
#if os(iOS)
#if os(iOS) || os(tvOS)
NavigationLink("Launch Default UIViewController", destination:
BaseUIViewControllerWrapper()
)
Expand Down
10 changes: 6 additions & 4 deletions builder/AutoTrackingMacOSTest/AutoTrackingMacOSTest.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>
409 changes: 383 additions & 26 deletions builder/tealium-swift.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions samples/ConsentManagerDemo/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PODS:
- Eureka (5.3.1)
- tealium-swift (2.4.6):
- tealium-swift/TealiumFull (= 2.4.6)
- tealium-swift/TealiumFull (2.4.6)
- tealium-swift (2.5.0):
- tealium-swift/TealiumFull (= 2.5.0)
- tealium-swift/TealiumFull (2.5.0)

DEPENDENCIES:
- Eureka (~> 5.3)
Expand All @@ -18,7 +18,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
Eureka: 859877ab1e85661b6b7e810015d430e937d9cc7d
tealium-swift: 4e3d50e04e79eabd84b272d066659f5234d74b55
tealium-swift: c4293fe0620a4b5c105f1415f331d3851ac219a7

PODFILE CHECKSUM: a08a1d1cef2344f90eb2215ef34bbdf985d4db40

Expand Down
8 changes: 4 additions & 4 deletions samples/TealiumMediaExample/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- tealium-swift (2.4.6):
- tealium-swift/TealiumFull (= 2.4.6)
- tealium-swift/TealiumFull (2.4.6)
- tealium-swift (2.5.0):
- tealium-swift/TealiumFull (= 2.5.0)
- tealium-swift/TealiumFull (2.5.0)

DEPENDENCIES:
- tealium-swift (from `../../`)
Expand All @@ -11,7 +11,7 @@ EXTERNAL SOURCES:
:path: "../../"

SPEC CHECKSUMS:
tealium-swift: 4e3d50e04e79eabd84b272d066659f5234d74b55
tealium-swift: c4293fe0620a4b5c105f1415f331d3851ac219a7

PODFILE CHECKSUM: 9f7c4052f5026295b89589ca935de017625dcaf3

Expand Down
11 changes: 6 additions & 5 deletions samples/TealiumSwiftExample/Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'TealiumSwiftExample' do
platform :ios, '11.0'
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

Expand All @@ -13,7 +14,7 @@ end
target 'TealiumJSInterfaceExample' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

platform :ios, '11.0'
# Pods for TealiumSwiftExample
pod "tealium-swift", :path=> "../.."

Expand All @@ -22,7 +23,7 @@ end
target 'TealiumSwiftWatchExample Extension' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!

platform :watchos, '3.0'
# Pods for TealiumSwiftWatchExample Extension
pod "tealium-swift/Core", :path=> "../.."
pod "tealium-swift/Collect", :path=> "../.."
Expand All @@ -33,7 +34,7 @@ end
target 'TealiumSwiftTVExample' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!

platform :tvos, '9.0'
# Pods for TealiumSwiftWatchExample Extension
pod "tealium-swift/Core", :path=> "../.."
pod "tealium-swift/Collect", :path=> "../.."
Expand All @@ -44,7 +45,7 @@ end
target 'WidgetExampleExtension' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!

platform :ios, '11.0'
# Pods for WidgetExampleExtension Extension
pod "tealium-swift", :path=> "../.."
end
20 changes: 10 additions & 10 deletions samples/TealiumSwiftExample/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
PODS:
- tealium-swift (2.4.6):
- tealium-swift/TealiumFull (= 2.4.6)
- tealium-swift/Collect (2.4.6):
- tealium-swift (2.5.0):
- tealium-swift/TealiumFull (= 2.5.0)
- tealium-swift/Collect (2.5.0):
- tealium-swift/Core
- tealium-swift/Core (2.4.6)
- tealium-swift/Lifecycle (2.4.6):
- tealium-swift/Core (2.5.0)
- tealium-swift/Lifecycle (2.5.0):
- tealium-swift/Core
- tealium-swift/TealiumFull (2.4.6)
- tealium-swift/VisitorService (2.4.6):
- tealium-swift/TealiumFull (2.5.0)
- tealium-swift/VisitorService (2.5.0):
- tealium-swift/Core

DEPENDENCIES:
Expand All @@ -22,8 +22,8 @@ EXTERNAL SOURCES:
:path: "../.."

SPEC CHECKSUMS:
tealium-swift: 4e3d50e04e79eabd84b272d066659f5234d74b55
tealium-swift: e99cbe922b673f11aacefc2b9acccd35643c8f29

PODFILE CHECKSUM: 41c18b7af41c1fe9dac003dc4e2ded9ad47a7078
PODFILE CHECKSUM: 875dfe1e0fd7a7a3e0d4508779a7df7183c540d7

COCOAPODS: 1.11.2
COCOAPODS: 1.10.1
14 changes: 7 additions & 7 deletions samples/VisitorServiceDemo/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
PODS:
- SCLAlertView (0.8)
- SwiftConfettiView (0.1.0)
- tealium-swift/Collect (2.4.6):
- tealium-swift/Collect (2.5.0):
- tealium-swift/Core
- tealium-swift/Core (2.4.6)
- tealium-swift/Lifecycle (2.4.6):
- tealium-swift/Core (2.5.0)
- tealium-swift/Lifecycle (2.5.0):
- tealium-swift/Core
- tealium-swift/Location (2.4.6):
- tealium-swift/Location (2.5.0):
- tealium-swift/Core
- tealium-swift/TagManagement (2.4.6):
- tealium-swift/TagManagement (2.5.0):
- tealium-swift/Core
- tealium-swift/VisitorService (2.4.6):
- tealium-swift/VisitorService (2.5.0):
- tealium-swift/Core

DEPENDENCIES:
Expand All @@ -35,7 +35,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
SCLAlertView: 6a77bb2edfc65e04dbe57725546cb4107a506b85
SwiftConfettiView: 1bdbc2e6913b6b1c76d8070802b212508ad5c352
tealium-swift: 4e3d50e04e79eabd84b272d066659f5234d74b55
tealium-swift: c4293fe0620a4b5c105f1415f331d3851ac219a7

PODFILE CHECKSUM: 90caa9f73ff21f41966a1c7699ab1b38ce3ee0b0

Expand Down
30 changes: 21 additions & 9 deletions support/tests/CoreMocks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class DummyCollector: Collector, DispatchListener, DispatchValidator {
var id: String

func shouldQueue(request: TealiumRequest) -> (Bool, [String: Any]?) {
return (false, nil)
return (false, ["dummyQueue": "dummyQueueValue"])
}

func shouldDrop(request: TealiumRequest) -> Bool {
Expand Down Expand Up @@ -112,6 +112,10 @@ class DummyDataManager: DataLayerManagerProtocol {
}

class DummyDispatchManagerConfigUpdate: DispatchManagerProtocol {
func checkShouldQueue(request: inout TealiumTrackRequest) -> Bool {
return true
}

var dispatchers: [Dispatcher]?

var dispatchListeners: [DispatchListener]?
Expand Down Expand Up @@ -182,7 +186,11 @@ class DummyDispatchManagerdequeue: DispatchManagerProtocol {
expectation.fulfill()
asyncExpectation = XCTestExpectation(description: "\(expectation.description)1")
}


func checkShouldQueue(request: inout TealiumTrackRequest) -> Bool {
return true
}

}

class DummyDataManagerNoData: DataLayerManagerProtocol {
Expand Down Expand Up @@ -241,6 +249,10 @@ class DummyDataManagerNoData: DataLayerManagerProtocol {
func startNewSession(with sessionStarter: SessionStarterProtocol) {

}

func checkShouldQueue(request: inout TealiumTrackRequest) -> Bool {
return true
}

}

Expand Down Expand Up @@ -319,8 +331,8 @@ class MockLegacyUserDefaults: Storable {
LifecycleKey.totalSleepCount: "8",
LifecycleKey.totalWakeCount: "7",
LifecycleKey.wakeCount: "7",
TealiumKey.visitorId: "205CA6D0FE3A4242A3522DBE7F5B75DE",
TealiumKey.uuid: "205CA6D0-FE3A-4242-A352-2DBE7F5B75DE",
TealiumDataKey.visitorId: "205CA6D0FE3A4242A3522DBE7F5B75DE",
TealiumDataKey.uuid: "205CA6D0-FE3A-4242-A352-2DBE7F5B75DE",
"custom_persistent_key": "customValue"]

func object(forKey defaultName: String) -> Any? {
Expand Down Expand Up @@ -442,12 +454,12 @@ class MockMigratedDataLayer: DataLayerManagerProtocol {
LifecycleKey.totalSleepCount: 8,
LifecycleKey.totalWakeCount: 7,
LifecycleKey.wakeCount: 7],
TealiumKey.visitorId: "205CA6D0FE3A4242A3522DBE7F5B75DE",
TealiumKey.uuid: "205CA6D0-FE3A-4242-A352-2DBE7F5B75DE",
TealiumDataKey.visitorId: "205CA6D0FE3A4242A3522DBE7F5B75DE",
TealiumDataKey.uuid: "205CA6D0-FE3A-4242-A352-2DBE7F5B75DE",
"custom_persistent_key": "customValue",
ConsentKey.consentStatus: 1,
ConsentKey.consentLoggingEnabled: true,
ConsentKey.consentCategoriesKey: [TealiumConsentCategories.affiliates.rawValue,
TealiumDataKey.consentStatus: 1,
TealiumDataKey.consentLoggingEnabled: true,
TealiumDataKey.consentCategoriesKey: [TealiumConsentCategories.affiliates.rawValue,
TealiumConsentCategories.bigData.rawValue,
TealiumConsentCategories.crm.rawValue,
TealiumConsentCategories.engagement.rawValue]]
Expand Down
18 changes: 9 additions & 9 deletions support/tests/TestTealiumHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ let testTrackRequest = TealiumTrackRequest(data: [:])

let testDataDictionary: [String: Any] =
[
TealiumKey.account: TealiumTestValue.account,
TealiumKey.profile: TealiumTestValue.profile,
TealiumKey.environment: TealiumTestValue.environment,
TealiumKey.event: TealiumTestValue.title,
TealiumKey.libraryName: TealiumValue.libraryName,
TealiumKey.libraryVersion: TealiumValue.libraryVersion,
TealiumKey.sessionId: TealiumTestValue.sessionId,
TealiumKey.visitorId: TealiumTestValue.visitorID,
TealiumKey.random: TealiumTestValue.random
TealiumDataKey.account: TealiumTestValue.account,
TealiumDataKey.profile: TealiumTestValue.profile,
TealiumDataKey.environment: TealiumTestValue.environment,
TealiumDataKey.event: TealiumTestValue.title,
TealiumDataKey.libraryName: TealiumValue.libraryName,
TealiumDataKey.libraryVersion: TealiumValue.libraryVersion,
TealiumDataKey.sessionId: TealiumTestValue.sessionId,
TealiumDataKey.visitorId: TealiumTestValue.visitorID,
TealiumDataKey.random: TealiumTestValue.random
]

class TimeTraveler {
Expand Down
36 changes: 18 additions & 18 deletions support/tests/test_tealium_attribution/MockAttributionData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ class MockAttributionData: AttributionDataProtocol {
var updateConversionValueCalled = 0
init() {
self.persistentAttributionData = PersistentAttributionData(withDictionary: [
AttributionKey.clickedWithin30D: "true",
AttributionKey.orgName: "org name",
AttributionKey.orgId: "555555",
AttributionKey.campaignId: "12345678",
AttributionKey.campaignName: "campaign name",
AttributionKey.conversionDate: "2020-01-04T17:18:07Z",
AttributionKey.conversionType: "Download",
AttributionKey.clickedDate: "2020-01-04T17:17:00Z",
AttributionKey.adGroupId: "12345678",
AttributionKey.adGroupName: "adgroup name",
AttributionKey.region: "US",
AttributionKey.adKeyword: "keyword",
AttributionKey.adKeywordMatchType: "Broad",
AttributionKey.creativeSetId: "12345678",
AttributionKey.creativeSetName: "Creative Set name"
TealiumDataKey.adClickedWithin30D: "true",
TealiumDataKey.adOrgName: "org name",
TealiumDataKey.adOrgId: "555555",
TealiumDataKey.adCampaignId: "12345678",
TealiumDataKey.adCampaignName: "campaign name",
TealiumDataKey.adConversionDate: "2020-01-04T17:18:07Z",
TealiumDataKey.adConversionType: "Download",
TealiumDataKey.adClickedDate: "2020-01-04T17:17:00Z",
TealiumDataKey.adGroupId: "12345678",
TealiumDataKey.adGroupName: "adgroup name",
TealiumDataKey.adRegion: "US",
TealiumDataKey.adKeyword: "keyword",
TealiumDataKey.adKeywordMatchType: "Broad",
TealiumDataKey.adCreativeSetId: "12345678",
TealiumDataKey.adCreativeSetName: "Creative Set name"
])
}

Expand All @@ -48,9 +48,9 @@ class MockAttributionData: AttributionDataProtocol {
}

var volatileData: [String: Any] {
[AttributionKey.idfa: idfa,
AttributionKey.idfv: idfv,
AttributionKey.isTrackingAllowed: isAdvertisingTrackingEnabled]
[TealiumDataKey.idfa: idfa,
TealiumDataKey.idfv: idfv,
TealiumDataKey.isTrackingAllowed: isAdvertisingTrackingEnabled]
}

var isAdvertisingTrackingEnabled: String = "true"
Expand Down
Loading

0 comments on commit 7d86521

Please sign in to comment.