From 1d2c64027955caa4f33fc22be7f7c2d9fe9ba26d Mon Sep 17 00:00:00 2001 From: Cornelius Horstmann Date: Fri, 6 Sep 2024 11:07:03 +0200 Subject: [PATCH] Add reset functionality (#434) * Add reset method to MatomoTracker * Updated macOS and iOS versions in the test target * Updated Quick and Nimble to their latest versions * Fixed Cocoapods Platform for unit tests * Updated Github Actions to macos 13 * Changed the UserDefault Keys to be an enum * Added minor tweaks to the reset functionality * Added Changelog Entry # Conflicts: # CHANGELOG.md * Added workaround for failing tests # Conflicts: # Gemfile.lock * Added running tests when merging to develop * trying to fix testing * Updating Bundler --------- Co-authored-by: Tobias Ottenweller --- .github/workflows/danger.yml | 2 +- .github/workflows/test.yml | 42 +++++----- CHANGELOG.md | 1 + Gemfile.lock | 2 +- MatomoTracker.xcodeproj/project.pbxproj | 2 + MatomoTracker/MatomoTracker.swift | 25 ++++++ MatomoTracker/MatomoUserDefaults.swift | 80 ++++++++++--------- .../EventAPISerializerSpec.swift | 2 +- MatomoTrackerTests/MemoryQueueSpec.swift | 8 +- .../PiwikUserDefaultsSpec.swift | 18 ++--- MatomoTrackerTests/TrackerSpec.swift | 79 +++++++++++++++++- Podfile | 19 ++++- 12 files changed, 204 insertions(+), 76 deletions(-) diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml index 6afa0f4e..cbd245f8 100644 --- a/.github/workflows/danger.yml +++ b/.github/workflows/danger.yml @@ -1,4 +1,4 @@ -name: CI +name: Run Danger on: pull_request: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 07eca2be..d3ef383d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,22 +1,25 @@ -name: CI +name: Run Tests on: pull_request: branches: - develop - + push: + branches: + - develop + jobs: tests-ios: - runs-on: macos-11 + runs-on: macos-13 strategy: matrix: - include: # selection of https://github.com/actions/runner-images/blob/main/images/macos/macos-11-Readme.md#installed-sdks - - xcode: "13.2.1" - ios: "15.2" - device: "iPhone 8" - - xcode: "12.5.1" - ios: "14.5" - device: "iPhone 8" + include: # selection of https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#installed-sdks + - xcode: "14.3.1" + ios: "16.4" + device: "iPhone 14" + # - xcode: "12.5.1" + # ios: "14.5" + # device: "iPhone 8" if: github.event_name == 'pull_request' # if only run pull request when multiple trigger workflow name: "test ios ${{matrix.ios}}" steps: @@ -32,19 +35,22 @@ jobs: - name: Run Unit Tests on ${{matrix.ios}} ${{matrix.device}} run: xcodebuild -workspace MatomoTracker.xcworkspace -scheme 'MatomoTracker' -sdk 'iphonesimulator' -destination 'platform=iOS Simulator,name=${{matrix.device}},OS=${{matrix.ios}}' -configuration Debug clean test tests-demo-builds: - runs-on: macos-11 + runs-on: macos-13 strategy: matrix: include: - scheme: "ios" sdk: "iphonesimulator" - destination: "platform=iOS Simulator,name=iPhone 8,OS=15.2" + destination: "platform=iOS Simulator,name=iPhone 14,OS=16.4" + xcode: "14.3.1" - scheme: "macos" sdk: "macosx" destination: "platform=macOS,arch=x86_64" + xcode: "14.3.1" - scheme: "tvos" sdk: "appletvsimulator" - destination: "platform=tvOS Simulator,name=Apple TV,OS=15.2" + destination: "platform=tvOS Simulator,name=Apple TV,OS=16.4" + xcode: "14.3.1" if: github.event_name == 'pull_request' # if only run pull request when multiple trigger workflow name: "test demo build ${{matrix.scheme}}" steps: @@ -55,16 +61,16 @@ jobs: bundler-cache: true - name: pod install run: pod install || pod install --repo-update - - name: "Select Xcode 13.2.1" - run: sudo xcode-select -switch /Applications/Xcode_13.2.1.app && /usr/bin/xcodebuild -version + - name: "Select Xcode ${{matrix.xcode}}" + run: sudo xcode-select -switch /Applications/Xcode_${{matrix.xcode}}.app && /usr/bin/xcodebuild -version - name: Build Demo for ${{matrix.scheme}} run: xcodebuild -workspace MatomoTracker.xcworkspace -scheme '${{matrix.scheme}}' -sdk '${{matrix.sdk}}' -destination '${{matrix.destination}}' -configuration Release clean build tests-package-managers: - runs-on: macos-11 + runs-on: macos-13 steps: - uses: actions/checkout@v3 - - name: "Select Xcode 11.7" - run: sudo xcode-select -switch /Applications/Xcode_13.2.1.app && /usr/bin/xcodebuild -version + - name: "Select Xcode 14.3.1" + run: sudo xcode-select -switch /Applications/Xcode_14.3.1.app && /usr/bin/xcodebuild -version # Carthage doesn't work well with Matomo anymore # https://github.com/Carthage/Carthage/issues/3146 # - name: "Build Carthage" diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bd3fa21..052bf37f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## Unreleased +* **feature** Added functionality to reset a Matomo instance. [#434](https://github.com/matomo-org/matomo-sdk-ios/pull/434) ## 7.6.0 * **feature** Added support for watchOS. [#352](https://github.com/matomo-org/matomo-sdk-ios/issues/352) diff --git a/Gemfile.lock b/Gemfile.lock index 9b803bc6..6635da7a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -157,4 +157,4 @@ DEPENDENCIES xcpretty BUNDLED WITH - 1.17.2 + 2.2.17 diff --git a/MatomoTracker.xcodeproj/project.pbxproj b/MatomoTracker.xcodeproj/project.pbxproj index ef14c796..f87990b0 100644 --- a/MatomoTracker.xcodeproj/project.pbxproj +++ b/MatomoTracker.xcodeproj/project.pbxproj @@ -636,6 +636,7 @@ INFOPLIST_FILE = MatomoTrackerTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.15; PRODUCT_BUNDLE_IDENTIFIER = org.matomo.MatomoTrackerTests; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -657,6 +658,7 @@ INFOPLIST_FILE = MatomoTrackerTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.15; PRODUCT_BUNDLE_IDENTIFIER = org.matomo.MatomoTrackerTests; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/MatomoTracker/MatomoTracker.swift b/MatomoTracker/MatomoTracker.swift index 40aea259..bf3a5724 100644 --- a/MatomoTracker/MatomoTracker.swift +++ b/MatomoTracker/MatomoTracker.swift @@ -468,3 +468,28 @@ extension MatomoTracker { /// The version of the Matomo SDKs @objc public static let sdkVersion = "7.5" } + +extension MatomoTracker { + /// Resets all session, visitor and campaign information. + /// + /// This function should only be called from the main thread + /// After calling this method this instance behaves like the app has been freshly installed. + public func reset() { + guard Thread.isMainThread else { + DispatchQueue.main.sync { + self.reset() + } + return + } + matomoUserDefaults.reset() + + visitor = Visitor.current(in: matomoUserDefaults) + session = Session.current(in: matomoUserDefaults) + dimensions = [] + customVariables = [] + campaignName = nil + campaignKeyword = nil + + startNewSession() + } +} diff --git a/MatomoTracker/MatomoUserDefaults.swift b/MatomoTracker/MatomoUserDefaults.swift index 5b149c94..f6579b82 100644 --- a/MatomoTracker/MatomoUserDefaults.swift +++ b/MatomoTracker/MatomoUserDefaults.swift @@ -13,121 +13,127 @@ internal struct MatomoUserDefaults { var totalNumberOfVisits: Int { get { - return userDefaults.integer(forKey: MatomoUserDefaults.Key.totalNumberOfVisits) + return userDefaults.integer(forKey: MatomoUserDefaults.Key.totalNumberOfVisits.rawValue) } set { - userDefaults.set(newValue, forKey: MatomoUserDefaults.Key.totalNumberOfVisits) + userDefaults.set(newValue, forKey: MatomoUserDefaults.Key.totalNumberOfVisits.rawValue) userDefaults.synchronize() } } var firstVisit: Date? { get { - return userDefaults.object(forKey: MatomoUserDefaults.Key.firstVistsTimestamp) as? Date + return userDefaults.object(forKey: MatomoUserDefaults.Key.firstVistsTimestamp.rawValue) as? Date } set { - userDefaults.set(newValue, forKey: MatomoUserDefaults.Key.firstVistsTimestamp) + userDefaults.set(newValue, forKey: MatomoUserDefaults.Key.firstVistsTimestamp.rawValue) userDefaults.synchronize() } } var previousVisit: Date? { get { - return userDefaults.object(forKey: MatomoUserDefaults.Key.previousVistsTimestamp) as? Date + return userDefaults.object(forKey: MatomoUserDefaults.Key.previousVistsTimestamp.rawValue) as? Date } set { - userDefaults.set(newValue, forKey: MatomoUserDefaults.Key.previousVistsTimestamp) + userDefaults.set(newValue, forKey: MatomoUserDefaults.Key.previousVistsTimestamp.rawValue) userDefaults.synchronize() } } var currentVisit: Date? { get { - return userDefaults.object(forKey: MatomoUserDefaults.Key.currentVisitTimestamp) as? Date + return userDefaults.object(forKey: MatomoUserDefaults.Key.currentVisitTimestamp.rawValue) as? Date } set { - userDefaults.set(newValue, forKey: MatomoUserDefaults.Key.currentVisitTimestamp) + userDefaults.set(newValue, forKey: MatomoUserDefaults.Key.currentVisitTimestamp.rawValue) userDefaults.synchronize() } } var optOut: Bool { get { - return userDefaults.bool(forKey: MatomoUserDefaults.Key.optOut) + return userDefaults.bool(forKey: MatomoUserDefaults.Key.optOut.rawValue) } set { - userDefaults.set(newValue, forKey: MatomoUserDefaults.Key.optOut) + userDefaults.set(newValue, forKey: MatomoUserDefaults.Key.optOut.rawValue) userDefaults.synchronize() } } var clientId: String? { get { - return userDefaults.string(forKey: MatomoUserDefaults.Key.clientID) + return userDefaults.string(forKey: MatomoUserDefaults.Key.clientID.rawValue) } set { - userDefaults.setValue(newValue, forKey: MatomoUserDefaults.Key.clientID) + userDefaults.setValue(newValue, forKey: MatomoUserDefaults.Key.clientID.rawValue) userDefaults.synchronize() } } var forcedVisitorId: String? { get { - return userDefaults.string(forKey: MatomoUserDefaults.Key.forcedVisitorID) + return userDefaults.string(forKey: MatomoUserDefaults.Key.forcedVisitorID.rawValue) } set { - userDefaults.setValue(newValue, forKey: MatomoUserDefaults.Key.forcedVisitorID) + userDefaults.setValue(newValue, forKey: MatomoUserDefaults.Key.forcedVisitorID.rawValue) userDefaults.synchronize() } } var visitorUserId: String? { get { - return userDefaults.string(forKey: MatomoUserDefaults.Key.visitorUserID); + return userDefaults.string(forKey: MatomoUserDefaults.Key.visitorUserID.rawValue); } set { - userDefaults.setValue(newValue, forKey: MatomoUserDefaults.Key.visitorUserID); + userDefaults.setValue(newValue, forKey: MatomoUserDefaults.Key.visitorUserID.rawValue); userDefaults.synchronize() } } var lastOrder: Date? { get { - return userDefaults.object(forKey: MatomoUserDefaults.Key.lastOrder) as? Date + return userDefaults.object(forKey: MatomoUserDefaults.Key.lastOrder.rawValue) as? Date } set { - userDefaults.set(newValue, forKey: MatomoUserDefaults.Key.lastOrder) + userDefaults.set(newValue, forKey: MatomoUserDefaults.Key.lastOrder.rawValue) + } + } + + func reset() { + for key in Key.allCases { + userDefaults.removeObject(forKey: key.rawValue) } } } extension MatomoUserDefaults { public mutating func copy(from userDefaults: UserDefaults) { - totalNumberOfVisits = userDefaults.integer(forKey: MatomoUserDefaults.Key.totalNumberOfVisits) - firstVisit = userDefaults.object(forKey: MatomoUserDefaults.Key.firstVistsTimestamp) as? Date - previousVisit = userDefaults.object(forKey: MatomoUserDefaults.Key.previousVistsTimestamp) as? Date - currentVisit = userDefaults.object(forKey: MatomoUserDefaults.Key.currentVisitTimestamp) as? Date - optOut = userDefaults.bool(forKey: MatomoUserDefaults.Key.optOut) - clientId = userDefaults.string(forKey: MatomoUserDefaults.Key.clientID) - forcedVisitorId = userDefaults.string(forKey: MatomoUserDefaults.Key.forcedVisitorID) - visitorUserId = userDefaults.string(forKey: MatomoUserDefaults.Key.visitorUserID) - lastOrder = userDefaults.object(forKey: MatomoUserDefaults.Key.lastOrder) as? Date + totalNumberOfVisits = userDefaults.integer(forKey: MatomoUserDefaults.Key.totalNumberOfVisits.rawValue) + firstVisit = userDefaults.object(forKey: MatomoUserDefaults.Key.firstVistsTimestamp.rawValue) as? Date + previousVisit = userDefaults.object(forKey: MatomoUserDefaults.Key.previousVistsTimestamp.rawValue) as? Date + currentVisit = userDefaults.object(forKey: MatomoUserDefaults.Key.currentVisitTimestamp.rawValue) as? Date + optOut = userDefaults.bool(forKey: MatomoUserDefaults.Key.optOut.rawValue) + clientId = userDefaults.string(forKey: MatomoUserDefaults.Key.clientID.rawValue) + forcedVisitorId = userDefaults.string(forKey: MatomoUserDefaults.Key.forcedVisitorID.rawValue) + visitorUserId = userDefaults.string(forKey: MatomoUserDefaults.Key.visitorUserID.rawValue) + lastOrder = userDefaults.object(forKey: MatomoUserDefaults.Key.lastOrder.rawValue) as? Date } } extension MatomoUserDefaults { - internal struct Key { - static let totalNumberOfVisits = "PiwikTotalNumberOfVistsKey" - static let currentVisitTimestamp = "PiwikCurrentVisitTimestampKey" - static let previousVistsTimestamp = "PiwikPreviousVistsTimestampKey" - static let firstVistsTimestamp = "PiwikFirstVistsTimestampKey" + internal enum Key: String, CaseIterable { + case totalNumberOfVisits = "PiwikTotalNumberOfVistsKey" + case currentVisitTimestamp = "PiwikCurrentVisitTimestampKey" + case previousVistsTimestamp = "PiwikPreviousVistsTimestampKey" + case firstVistsTimestamp = "PiwikFirstVistsTimestampKey" // Note: To be compatible with previous versions, the clientID key retains its old value, // even though it is now a misnomer since adding visitorUserID makes it a bit confusing. - static let clientID = "PiwikVisitorIDKey" - static let forcedVisitorID = "PiwikForcedVisitorIDKey" - static let visitorUserID = "PiwikVisitorUserIDKey" - static let optOut = "PiwikOptOutKey" - static let lastOrder = "PiwikLastOrderDateKey" + case clientID = "PiwikVisitorIDKey" + case forcedVisitorID = "PiwikForcedVisitorIDKey" + case visitorUserID = "PiwikVisitorUserIDKey" + case optOut = "PiwikOptOutKey" + case lastOrder = "PiwikLastOrderDateKey" } } diff --git a/MatomoTrackerTests/EventAPISerializerSpec.swift b/MatomoTrackerTests/EventAPISerializerSpec.swift index b57888c3..efd79218 100644 --- a/MatomoTrackerTests/EventAPISerializerSpec.swift +++ b/MatomoTrackerTests/EventAPISerializerSpec.swift @@ -3,7 +3,7 @@ import Quick import Nimble class EventAPISerializerSpec: QuickSpec { - override func spec() { + override class func spec() { describe("queryItems") { it("encodes special characters") { let dimension = CustomDimension(index: 42, value: ###";'"|\,.<>?/+_=-)(*&^%$#@!"###) diff --git a/MatomoTrackerTests/MemoryQueueSpec.swift b/MatomoTrackerTests/MemoryQueueSpec.swift index 5086edba..ae6fa9b0 100644 --- a/MatomoTrackerTests/MemoryQueueSpec.swift +++ b/MatomoTrackerTests/MemoryQueueSpec.swift @@ -3,12 +3,12 @@ import Quick import Nimble class MemoryQueueSpec: QuickSpec { - override func setUp() { - Nimble.AsyncDefaults.timeout = .seconds(10) - Nimble.AsyncDefaults.pollInterval = .milliseconds(100) + override class func setUp() { + Nimble.PollingDefaults.timeout = .seconds(10) + Nimble.PollingDefaults.pollInterval = .milliseconds(100) } - override func spec() { + override class func spec() { describe("init") { it("should return not null") { let queue = MemoryQueue() diff --git a/MatomoTrackerTests/PiwikUserDefaultsSpec.swift b/MatomoTrackerTests/PiwikUserDefaultsSpec.swift index 2044e8ec..8a3fbcb2 100644 --- a/MatomoTrackerTests/PiwikUserDefaultsSpec.swift +++ b/MatomoTrackerTests/PiwikUserDefaultsSpec.swift @@ -3,7 +3,7 @@ import Quick import Nimble class MatomoUserDefaultsSpec: QuickSpec { - override func spec() { + override class func spec() { describe("suiteMigration") { it("should migrate data for the default suite") { self.setMigrateableData(totalNumberOfVisists: 10, firstVisit: Date(timeIntervalSince1970: 100), previousVisit: Date(timeIntervalSince1970: 101), currentVisit: Date(timeIntervalSince1970: 102), optOut: true, clientId: "_specVisitorID") @@ -21,7 +21,7 @@ class MatomoUserDefaultsSpec: QuickSpec { } /// Tries to remove all data stored in a given suite - private func removeAllInSuite(suite: String) { + private class func removeAllInSuite(suite: String) { guard let newuserDefaults = UserDefaults(suiteName: suite) else { return } let allKeys: [String]? = Array(newuserDefaults.dictionaryRepresentation().keys) for key in allKeys ?? [] { @@ -29,12 +29,12 @@ class MatomoUserDefaultsSpec: QuickSpec { } } - private func setMigrateableData(totalNumberOfVisists: Int, firstVisit: Date?, previousVisit: Date?, currentVisit: Date?, optOut: Bool, clientId: String?) { - UserDefaults.standard.set(totalNumberOfVisists, forKey: MatomoUserDefaults.Key.totalNumberOfVisits) - UserDefaults.standard.set(firstVisit, forKey: MatomoUserDefaults.Key.firstVistsTimestamp) - UserDefaults.standard.set(previousVisit, forKey: MatomoUserDefaults.Key.previousVistsTimestamp) - UserDefaults.standard.set(currentVisit, forKey: MatomoUserDefaults.Key.currentVisitTimestamp) - UserDefaults.standard.set(optOut, forKey: MatomoUserDefaults.Key.optOut) - UserDefaults.standard.set(clientId, forKey: MatomoUserDefaults.Key.clientID) + private class func setMigrateableData(totalNumberOfVisists: Int, firstVisit: Date?, previousVisit: Date?, currentVisit: Date?, optOut: Bool, clientId: String?) { + UserDefaults.standard.set(totalNumberOfVisists, forKey: MatomoUserDefaults.Key.totalNumberOfVisits.rawValue) + UserDefaults.standard.set(firstVisit, forKey: MatomoUserDefaults.Key.firstVistsTimestamp.rawValue) + UserDefaults.standard.set(previousVisit, forKey: MatomoUserDefaults.Key.previousVistsTimestamp.rawValue) + UserDefaults.standard.set(currentVisit, forKey: MatomoUserDefaults.Key.currentVisitTimestamp.rawValue) + UserDefaults.standard.set(optOut, forKey: MatomoUserDefaults.Key.optOut.rawValue) + UserDefaults.standard.set(clientId, forKey: MatomoUserDefaults.Key.clientID.rawValue) } } diff --git a/MatomoTrackerTests/TrackerSpec.swift b/MatomoTrackerTests/TrackerSpec.swift index 50979db9..345cc510 100644 --- a/MatomoTrackerTests/TrackerSpec.swift +++ b/MatomoTrackerTests/TrackerSpec.swift @@ -3,8 +3,8 @@ import Quick import Nimble class TrackerSpec: QuickSpec { - override func spec() { - Nimble.AsyncDefaults.timeout = .seconds(5) + override class func spec() { + Nimble.PollingDefaults.timeout = .seconds(5) describe("init") { it("should be able to initialized the MatomoTracker with a URL ending on `matomo.php`") { let tracker = MatomoTracker(siteId: "5", baseURL: URL(string: "https://example.com/matomo.php")!) @@ -135,5 +135,80 @@ class TrackerSpec: QuickSpec { expect(tracker2.forcedVisitorId) == "0123456789abcdef" } } + describe("reset") { + it("generates new visitor") { + var queuedEvents = [Event]() + let queue = QueueMock() + let tracker = MatomoTracker.fixture(queue: queue, dispatcher: DispatcherMock()) + queue.enqueueEventsHandler = { events, _ in + queuedEvents += events + } + + tracker.track(view: ["spec_view"]) + tracker.reset() + tracker.track(view: ["spec_view"]) + + expect(queuedEvents.count) == 2 + expect(queuedEvents.first?.visitor.id).toNot(equal(queuedEvents.last?.visitor.id)) + } + it("clears session information") { + var queuedEvent: Event? = nil + let queue = QueueMock() + let tracker = MatomoTracker.fixture(queue: queue, dispatcher: DispatcherMock()) + queue.enqueueEventsHandler = { events, _ in + queuedEvent = events.first + } + + tracker.startNewSession() + tracker.reset() + tracker.track(view: ["spec_view"]) + + expect(queuedEvent?.session.sessionsCount) == 1 + } + it("clears dimensions") { + var queuedEvent: Event? = nil + let queue = QueueMock() + let tracker = MatomoTracker.fixture(queue: queue, dispatcher: DispatcherMock()) + queue.enqueueEventsHandler = { events, _ in + queuedEvent = events.first + } + + tracker.set(dimension: CustomDimension(index: 0, value: "fake-dimension")) + tracker.reset() + tracker.track(view: ["spec_view"]) + + expect(queuedEvent?.dimensions).to(beEmpty()) + } + it("removes all custom variables") { + var queuedEvent: Event? = nil + let queue = QueueMock() + let tracker = MatomoTracker.fixture(queue: queue, dispatcher: DispatcherMock()) + queue.enqueueEventsHandler = { events, _ in + queuedEvent = events.first + } + + tracker.set(customVariable: CustomVariable(index: 0, name: "fake-variable", value: "fake-value")) + tracker.reset() + tracker.track(view: ["spec_view"]) + + expect(queuedEvent?.customVariables).to(beEmpty()) + } + it("clear campaigns") { + var queuedEvent: Event? = nil + let queue = QueueMock() + let tracker = MatomoTracker.fixture(queue: queue, dispatcher: DispatcherMock()) + queue.enqueueEventsHandler = { events, _ in + queuedEvent = events.first + } + + tracker.trackCampaign(name: "fake-campaign", keyword: "fake-keyword") + tracker.reset() + tracker.track(view: ["spec_view"]) + + expect(queuedEvent).toNot(beNil()) + expect(queuedEvent?.campaignName).to(beNil()) + expect(queuedEvent?.campaignKeyword).to(beNil()) + } + } } } diff --git a/Podfile b/Podfile index ef1270aa..e85095f0 100644 --- a/Podfile +++ b/Podfile @@ -28,12 +28,25 @@ end target 'MatomoTrackerTests' do use_frameworks! - platform :ios, '11.0' + platform :ios, '13.0' inhibit_all_warnings! project 'MatomoTracker' workspace 'MatomoTracker' inherit! :search_paths - pod 'Quick', '~> 5.0' - pod 'Nimble', '~> 10.0' + pod 'Quick', '~> 7.0' + pod 'Nimble', '~> 12.0' end + +# https://github.com/CocoaPods/CocoaPods/issues/11402 +post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + + # disable code signing for pods + config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = "" + config.build_settings['CODE_SIGNING_REQUIRED'] = "NO" + config.build_settings['CODE_SIGNING_ALLOWED'] = "NO" + end + end +end \ No newline at end of file