From 7a77019a7981fc540de97637be100f71c646a906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Sun, 11 Aug 2024 12:19:52 +0200 Subject: [PATCH 1/5] Bump version number --- Demo/Demo.xcconfig | 2 +- Package.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Demo/Demo.xcconfig b/Demo/Demo.xcconfig index 1519e6c0..aab64b9b 100644 --- a/Demo/Demo.xcconfig +++ b/Demo/Demo.xcconfig @@ -1,5 +1,5 @@ // Version information -MARKETING_VERSION = 9.1.3 +MARKETING_VERSION = 9.1.4 // Deployment targets IPHONEOS_DEPLOYMENT_TARGET = 12.0 diff --git a/Package.swift b/Package.swift index 6d006b43..4c0c47d7 100644 --- a/Package.swift +++ b/Package.swift @@ -3,7 +3,7 @@ import PackageDescription struct ProjectSettings { - static let marketingVersion: String = "9.1.3" + static let marketingVersion: String = "9.1.4" } let package = Package( From c6feb2f8832ae4cd1847f518c1cf34c7a0ab9e50 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Bertholon Date: Sun, 11 Aug 2024 12:52:32 +0200 Subject: [PATCH 2/5] Update workspace package resolved files --- .../xcshareddata/swiftpm/Package.resolved | 12 ++++++------ .../xcshareddata/swiftpm/Package.resolved | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Demo/SRGAnalytics-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Demo/SRGAnalytics-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved index e60df3bb..8452e33a 100644 --- a/Demo/SRGAnalytics-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Demo/SRGAnalytics-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -60,8 +60,8 @@ "repositoryURL": "https://github.com/SRGSSR/srgappearance-apple.git", "state": { "branch": null, - "revision": "37858eb83365f498d3861cc546ba86a51e061293", - "version": "5.2.1" + "revision": "17415ec82264d47d882c19a5db33e1be31fb1de5", + "version": "5.2.2" } }, { @@ -78,8 +78,8 @@ "repositoryURL": "https://github.com/SRGSSR/srgdataprovider-apple.git", "state": { "branch": null, - "revision": "ae92436f7861651e66de5d33d2c0d1cf7d73345e", - "version": "19.0.0" + "revision": "a315d507213ed16adc3d827aadc6b266c6e21275", + "version": "19.0.6" } }, { @@ -114,8 +114,8 @@ "repositoryURL": "https://github.com/SRGSSR/srgmediaplayer-apple.git", "state": { "branch": null, - "revision": "717608146d3787bd269d5a524e109ee30be828e4", - "version": "7.2.1" + "revision": "354b2c5bb53b412504c49c85639620677aeb4948", + "version": "7.2.3" } }, { diff --git a/Tests/SRGAnalyticsIdentity-tests.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Tests/SRGAnalyticsIdentity-tests.xcworkspace/xcshareddata/swiftpm/Package.resolved index cfcc593b..a2e2d06e 100644 --- a/Tests/SRGAnalyticsIdentity-tests.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Tests/SRGAnalyticsIdentity-tests.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -69,8 +69,8 @@ "repositoryURL": "https://github.com/SRGSSR/srgappearance-apple.git", "state": { "branch": null, - "revision": "37858eb83365f498d3861cc546ba86a51e061293", - "version": "5.2.1" + "revision": "17415ec82264d47d882c19a5db33e1be31fb1de5", + "version": "5.2.2" } }, { @@ -87,8 +87,8 @@ "repositoryURL": "https://github.com/SRGSSR/srgdataprovider-apple.git", "state": { "branch": null, - "revision": "ae92436f7861651e66de5d33d2c0d1cf7d73345e", - "version": "19.0.0" + "revision": "a315d507213ed16adc3d827aadc6b266c6e21275", + "version": "19.0.6" } }, { @@ -123,8 +123,8 @@ "repositoryURL": "https://github.com/SRGSSR/srgmediaplayer-apple.git", "state": { "branch": null, - "revision": "717608146d3787bd269d5a524e109ee30be828e4", - "version": "7.2.1" + "revision": "354b2c5bb53b412504c49c85639620677aeb4948", + "version": "7.2.3" } }, { From 2c59ff86edd270a97d2e357c7ab03f792df3fe19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20D=C3=A9fago?= Date: Wed, 13 Nov 2024 09:08:04 +0100 Subject: [PATCH 3/5] Remove app installation measurements (#97) --- .../xcschemes/SRGAnalytics-Package.xcscheme | 3 + .xcode-version | 2 +- Gemfile.lock | 155 +++++++++--------- Makefile | 4 +- ...LSApplicationQueriesSchemesGenerator.swift | 64 -------- Sources/SRGAnalytics/SRGAnalyticsTracker.m | 77 --------- .../NSNotificationCenter+Tests.m | 11 -- Tests/SRGAnalyticsTests/XCTestCase+Tests.m | 12 -- docs/README.md | 15 -- fastlane/Fastfile | 2 +- 10 files changed, 85 insertions(+), 260 deletions(-) delete mode 100755 Scripts/LSApplicationQueriesSchemesGenerator.swift diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/SRGAnalytics-Package.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/SRGAnalytics-Package.xcscheme index 87b7209d..9d8a390b 100644 --- a/.swiftpm/xcode/xcshareddata/xcschemes/SRGAnalytics-Package.xcscheme +++ b/.swiftpm/xcode/xcshareddata/xcschemes/SRGAnalytics-Package.xcscheme @@ -111,6 +111,9 @@ + + diff --git a/.xcode-version b/.xcode-version index 441e3fb3..67eb8073 100644 --- a/.xcode-version +++ b/.xcode-version @@ -1 +1 @@ -15.4 \ No newline at end of file +16.1 \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 7a393144..7001ac6c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,43 +1,45 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.6) + CFPropertyList (3.0.7) + base64 + nkf rexml - addressable (2.8.1) - public_suffix (>= 2.0.2, < 6.0) - artifactory (3.0.15) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + artifactory (3.0.17) atomos (0.1.3) - aws-eventstream (1.2.0) - aws-partitions (1.709.0) - aws-sdk-core (3.170.0) - aws-eventstream (~> 1, >= 1.0.2) - aws-partitions (~> 1, >= 1.651.0) - aws-sigv4 (~> 1.5) + aws-eventstream (1.3.0) + aws-partitions (1.1001.0) + aws-sdk-core (3.211.0) + aws-eventstream (~> 1, >= 1.3.0) + aws-partitions (~> 1, >= 1.992.0) + aws-sigv4 (~> 1.9) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.62.0) - aws-sdk-core (~> 3, >= 3.165.0) - aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.119.0) - aws-sdk-core (~> 3, >= 3.165.0) + aws-sdk-kms (1.95.0) + aws-sdk-core (~> 3, >= 3.210.0) + aws-sigv4 (~> 1.5) + aws-sdk-s3 (1.169.0) + aws-sdk-core (~> 3, >= 3.210.0) aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.4) - aws-sigv4 (1.5.2) + aws-sigv4 (~> 1.5) + aws-sigv4 (1.10.1) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) + base64 (0.2.0) claide (1.1.0) colored (1.2) colored2 (3.1.2) commander (4.6.0) highline (~> 2.0.0) declarative (0.0.20) - digest-crc (0.6.4) + digest-crc (0.6.5) rake (>= 12.0.0, < 14.0.0) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) + domain_name (0.6.20240107) dotenv (2.8.1) emoji_regex (3.2.3) - excon (0.99.0) - faraday (1.10.3) + excon (0.112.0) + faraday (1.10.4) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) @@ -58,22 +60,22 @@ GEM faraday-httpclient (1.0.1) faraday-multipart (1.0.4) multipart-post (~> 2) - faraday-net_http (1.0.1) + faraday-net_http (1.0.2) faraday-net_http_persistent (1.2.0) faraday-patron (1.0.0) faraday-rack (1.0.0) faraday-retry (1.0.3) - faraday_middleware (1.2.0) + faraday_middleware (1.2.1) faraday (~> 1.0) - fastimage (2.2.6) - fastlane (2.211.0) + fastimage (2.3.1) + fastlane (2.225.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) aws-sdk-s3 (~> 1.0) babosa (>= 1.0.3, < 2.0.0) bundler (>= 1.12.0, < 3.0.0) - colored + colored (~> 1.2) commander (~> 4.6) dotenv (>= 2.1.1, < 3.0.0) emoji_regex (>= 0.1, < 4.0) @@ -82,33 +84,38 @@ GEM faraday-cookie_jar (~> 0.0.6) faraday_middleware (~> 1.0) fastimage (>= 2.1.0, < 3.0.0) + fastlane-sirp (>= 1.0.0) gh_inspector (>= 1.1.2, < 2.0.0) google-apis-androidpublisher_v3 (~> 0.3) google-apis-playcustomapp_v1 (~> 0.1) + google-cloud-env (>= 1.6.0, < 2.0.0) google-cloud-storage (~> 1.31) highline (~> 2.0) + http-cookie (~> 1.0.5) json (< 3.0.0) jwt (>= 2.1.0, < 3) mini_magick (>= 4.9.4, < 5.0.0) - multipart-post (~> 2.0.0) + multipart-post (>= 2.0.0, < 3.0.0) naturally (~> 2.2) - optparse (~> 0.1.1) + optparse (>= 0.1.1, < 1.0.0) plist (>= 3.1.0, < 4.0.0) rubyzip (>= 2.0.0, < 3.0.0) - security (= 0.1.3) + security (= 0.1.5) simctl (~> 1.6.3) terminal-notifier (>= 2.0.0, < 3.0.0) - terminal-table (>= 1.4.5, < 2.0.0) + terminal-table (~> 3) tty-screen (>= 0.6.3, < 1.0.0) tty-spinner (>= 0.8.0, < 1.0.0) word_wrap (~> 1.0.0) xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.3.0) - xcpretty-travis-formatter (>= 0.0.3) + xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) + fastlane-sirp (1.0.0) + sysrandom (~> 1.0) gh_inspector (1.1.3) - google-apis-androidpublisher_v3 (0.33.0) - google-apis-core (>= 0.9.1, < 2.a) - google-apis-core (0.11.0) + google-apis-androidpublisher_v3 (0.54.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-core (0.11.3) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.16.2, < 2.a) httpclient (>= 2.8.1, < 3.a) @@ -116,65 +123,63 @@ GEM representable (~> 3.0) retriable (>= 2.0, < 4.a) rexml - webrick - google-apis-iamcredentials_v1 (0.16.0) - google-apis-core (>= 0.9.1, < 2.a) - google-apis-playcustomapp_v1 (0.12.0) - google-apis-core (>= 0.9.1, < 2.a) - google-apis-storage_v1 (0.19.0) - google-apis-core (>= 0.9.0, < 2.a) - google-cloud-core (1.6.0) - google-cloud-env (~> 1.0) + google-apis-iamcredentials_v1 (0.17.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-playcustomapp_v1 (0.13.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-storage_v1 (0.31.0) + google-apis-core (>= 0.11.0, < 2.a) + google-cloud-core (1.7.1) + google-cloud-env (>= 1.0, < 3.a) google-cloud-errors (~> 1.0) google-cloud-env (1.6.0) faraday (>= 0.17.3, < 3.0) - google-cloud-errors (1.3.0) - google-cloud-storage (1.44.0) + google-cloud-errors (1.4.0) + google-cloud-storage (1.47.0) addressable (~> 2.8) digest-crc (~> 0.4) google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.19.0) + google-apis-storage_v1 (~> 0.31.0) google-cloud-core (~> 1.6) googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) - googleauth (1.3.0) + googleauth (1.8.1) faraday (>= 0.17.3, < 3.a) jwt (>= 1.4, < 3.0) - memoist (~> 0.16) multi_json (~> 1.11) os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) highline (2.0.3) - http-cookie (1.0.5) + http-cookie (1.0.7) domain_name (~> 0.5) httpclient (2.8.3) jmespath (1.6.2) - json (2.6.3) - jwt (2.7.0) - memoist (0.16.2) - mini_magick (4.12.0) - mini_mime (1.1.2) + json (2.7.6) + jwt (2.9.3) + base64 + mini_magick (4.13.2) + mini_mime (1.1.5) multi_json (1.15.0) - multipart-post (2.0.0) - nanaimo (0.3.0) + multipart-post (2.4.1) + nanaimo (0.4.0) naturally (2.2.1) - optparse (0.1.1) + nkf (0.2.0) + optparse (0.5.0) os (1.1.4) - plist (3.6.0) - public_suffix (5.0.1) - rake (13.0.6) + plist (3.7.1) + public_suffix (6.0.1) + rake (13.2.1) representable (3.2.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) retriable (3.1.2) - rexml (3.2.8) - strscan (>= 3.0.9) + rexml (3.3.9) rouge (2.0.7) ruby2_keywords (0.0.5) rubyzip (2.3.2) - security (0.1.3) - signet (0.17.0) + security (0.1.5) + signet (0.19.0) addressable (~> 2.8) faraday (>= 0.17.5, < 3.a) jwt (>= 1.5, < 3.0) @@ -182,29 +187,25 @@ GEM simctl (1.6.10) CFPropertyList naturally - strscan (3.1.0) + sysrandom (1.0.5) terminal-notifier (2.0.0) - terminal-table (1.8.0) - unicode-display_width (~> 1.1, >= 1.1.1) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) trailblazer-option (0.1.2) tty-cursor (0.7.1) - tty-screen (0.8.1) + tty-screen (0.8.2) tty-spinner (0.9.3) tty-cursor (~> 0.7) uber (0.1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.8.2) - unicode-display_width (1.8.0) - webrick (1.8.1) + unicode-display_width (2.6.0) word_wrap (1.0.0) - xcodeproj (1.22.0) + xcodeproj (1.27.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) - nanaimo (~> 0.3.0) - rexml (~> 3.2.4) + nanaimo (~> 0.4.0) + rexml (>= 3.3.6, < 4.0) xcpretty (0.3.0) rouge (~> 2.0.7) xcpretty-travis-formatter (1.0.1) diff --git a/Makefile b/Makefile index d2b468cc..b24dc420 100644 --- a/Makefile +++ b/Makefile @@ -6,13 +6,13 @@ all: test-ios test-tvos test-ios-identity test-tvos-identity .PHONY: test-ios test-ios: @echo "Running iOS unit tests..." - @xcodebuild test -scheme SRGAnalytics-Package -destination 'platform=iOS Simulator,name=iPhone 11' 2> /dev/null + @xcodebuild test -scheme SRGAnalytics-Package -destination 'platform=iOS Simulator,name=iPhone 16' 2> /dev/null @echo "... done.\n" .PHONY: test-ios-identity test-ios-identity: @echo "Running iOS identity unit tests..." - @pushd Tests > /dev/null; xcodebuild test -workspace SRGAnalyticsIdentity-tests.xcworkspace -scheme SRGAnalyticsIdentity-tests -destination 'platform=iOS Simulator,name=iPhone 11' 2> /dev/null + @pushd Tests > /dev/null; xcodebuild test -workspace SRGAnalyticsIdentity-tests.xcworkspace -scheme SRGAnalyticsIdentity-tests -destination 'platform=iOS Simulator,name=iPhone 16' 2> /dev/null @echo "... done.\n" .PHONY: test-tvos diff --git a/Scripts/LSApplicationQueriesSchemesGenerator.swift b/Scripts/LSApplicationQueriesSchemesGenerator.swift deleted file mode 100755 index d0120dea..00000000 --- a/Scripts/LSApplicationQueriesSchemesGenerator.swift +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/swift - -/* - * The library automatically tracks which SRG SSR applications are installed on a user device - * and sends this information to comScore. For this mechanism to work properly, your application - * must declare all official SRG SSR application URL schemes as being supported in the Info.plist - * file under LSApplicationQueriesSchemes. - * - * This script fetches all known schemes and writes out a plist for your convenience. - * - * @see https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html - */ - -import Foundation - -/* The remote file contains a json with the schemes of all available SRG SSR apps. */ -let configURL = URL(string: "https://pastebin.com/raw/RnZYEWCA")! - -/* Name of plist file to store the schemes to. */ -let fileName = "schemes.plist" - -var waiting = true - -print("☁️ Fetching configuration from server...") - -let task = URLSession.shared.dataTask(with: configURL, completionHandler: { (data, _, _) in - - guard let data = data else { - print("❌ Fetching configuration from remote server failed.") - return - } - - print("✔︎ Configuration download successful.") - - do { - let json = try JSONSerialization.jsonObject(with: data, options: [.allowFragments]) - if let content = json as? NSArray { - let schemes = content.compactMap({ (entry) -> String? in - guard let entry = entry as? NSDictionary else { - return nil - } - if let scheme = entry.object(forKey: "ios") as? String { - return scheme.isEmpty ? nil : scheme - } - return nil - }) - - print("💾 Saving schemes to file \(fileName)") - let schemesDictionary = ["LSApplicationQueriesSchemes": schemes] - let written = (schemesDictionary as NSDictionary).write(toFile: fileName, atomically: true) - if written { - print("Done. Thanks. Bye. 🎉") - } else { - print("❌ Error while writing file to disk.") - } - } - waiting = false - } catch { - print("❌ Parsing downloaded content failed. Doesn't seem to be JSON.") - } -}) -task.resume() - -while waiting {} diff --git a/Sources/SRGAnalytics/SRGAnalyticsTracker.m b/Sources/SRGAnalytics/SRGAnalyticsTracker.m index f477dc18..7d9f8c2f 100644 --- a/Sources/SRGAnalytics/SRGAnalyticsTracker.m +++ b/Sources/SRGAnalytics/SRGAnalyticsTracker.m @@ -91,8 +91,6 @@ - (void)startWithConfiguration:(SRGAnalyticsConfiguration *)configuration [self startComScoreWithConfiguration:configuration]; [self startCommandersActWithConfiguration:configuration]; - - [self sendApplicationList]; } - (void)startComScoreWithConfiguration:(SRGAnalyticsConfiguration *)configuration @@ -462,81 +460,6 @@ - (void)trackCommandersActEventWithName:(NSString *)name labels:(SRGAnalyticsEve [self sendCommandersActCustomEventWithName:name labels:fullLabels.copy]; } -#pragma mark Application list measurement - -- (void)sendApplicationList -{ - // Tracks which SRG SSR applications are installed on the user device - // - // Specifications are available at: https://confluence.srg.beecollaboration.com/display/INTFORSCHUNG/App+Overlapping+Measurement - // - // This measurement is not critical and is therefore performed only once the tracker starts. If it fails for some reason - // (no network, for example), the measurement will be attempted again the next time the application is started - NSURL *applicationListURL = [NSURL URLWithString:@"https://pastebin.com/raw/RnZYEWCA"]; - [[[NSURLSession sharedSession] dataTaskWithURL:applicationListURL completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { - if (error) { - SRGAnalyticsLogError(@"tracker", @"The application list could not be retrieved. Reason: %@", error); - return; - } - - NSError *parseError = nil; - id JSONObject = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError]; - if (! JSONObject || ! [JSONObject isKindOfClass:NSArray.class]) { - SRGAnalyticsLogError(@"tracker", @"The application list format is incorrect"); - return; - } - NSArray *applicationDictionaries = JSONObject; - - // -canOpenURL: should only be called from the main thread - dispatch_async(dispatch_get_main_queue(), ^{ - // Extract URL schemes and installed applications - NSMutableSet *URLSchemes = [NSMutableSet set]; - NSMutableSet *installedApplications = [NSMutableSet set]; - for (NSDictionary *applicationDictionary in applicationDictionaries) { - NSString *application = applicationDictionary[@"code"]; - NSString *URLScheme = applicationDictionary[@"ios"]; - - if (URLScheme.length == 0 || ! application) { - SRGAnalyticsLogInfo(@"tracker", @"URL scheme or application name missing in %@. Skipped", applicationDictionary); - continue; - } - - [URLSchemes addObject:URLScheme]; - - NSString *URLString = [NSString stringWithFormat:@"%@://probe-for-srganalytics", URLScheme]; - if (! [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:URLString]]) { - continue; - } - - [installedApplications addObject:application]; - } - - // To be able to open a URL in another application (and thus to be able to test for URL scheme support), - // the application must declare the schemes it supports via its Info.plist file (under the - // `LSApplicationQueriesSchemes` key). Check that the app list is consistent with the remote list, and - // log an error if this is not the case. - NSArray *declaredURLSchemesArray = NSBundle.mainBundle.infoDictionary[@"LSApplicationQueriesSchemes"]; - NSSet *declaredURLSchemes = declaredURLSchemesArray ? [NSSet setWithArray:declaredURLSchemesArray] : [NSSet set]; - if (! [URLSchemes isSubsetOfSet:declaredURLSchemes]) { - SRGAnalyticsLogError(@"tracker", @"The URL schemes declared in your application Info.plist file under the " - "'LSApplicationQueriesSchemes' key must at least contain the scheme list available at " - "https://pastebin.com/raw/RnZYEWCA (the schemes are found under the 'ios' key, or " - "a script is available in the SRGAnalytics repository to extract them). Please " - "update your Info.plist file accordingly to make this message disappear."); - } - - NSArray *sortedInstalledApplications = [installedApplications.allObjects sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)]; - - SRGAnalyticsEventLabels *labels = [[SRGAnalyticsEventLabels alloc] init]; - labels.type = @"hidden"; - labels.source = @"SRGAnalytics"; - labels.value = [sortedInstalledApplications componentsJoinedByString:@";"]; - - [self trackEventWithName:@"Installed Apps" labels:labels]; - }); - }] resume]; -} - #pragma mark Description - (NSString *)description diff --git a/Tests/SRGAnalyticsTests/NSNotificationCenter+Tests.m b/Tests/SRGAnalyticsTests/NSNotificationCenter+Tests.m index 82bd4301..a1817644 100644 --- a/Tests/SRGAnalyticsTests/NSNotificationCenter+Tests.m +++ b/Tests/SRGAnalyticsTests/NSNotificationCenter+Tests.m @@ -32,11 +32,6 @@ @implementation NSNotificationCenter (Tests) return; } - // Discard app overlap measurements - if ([event isEqualToString:@"Installed Apps"]) { - return; - } - block(event, labels); }]; } @@ -135,12 +130,6 @@ @implementation NSNotificationCenter (Tests) return; } - // Discard app overlap measurements - NSString *name = labels[@"srg_title"]; - if ([name isEqualToString:@"Installed Apps"]) { - return; - } - block(event, labels); }]; } diff --git a/Tests/SRGAnalyticsTests/XCTestCase+Tests.m b/Tests/SRGAnalyticsTests/XCTestCase+Tests.m index 88969f2d..bb6453bb 100644 --- a/Tests/SRGAnalyticsTests/XCTestCase+Tests.m +++ b/Tests/SRGAnalyticsTests/XCTestCase+Tests.m @@ -77,12 +77,6 @@ - (XCTestExpectation *)expectationForEventNotificationWithHandler:(EventExpectat return NO; } - // Discard app overlap measurements - NSString *name = labels[@"event_title"]; - if ([name isEqualToString:@"Installed Apps"]) { - return NO; - } - return handler(event, labels); }]; } @@ -135,12 +129,6 @@ - (XCTestExpectation *)expectationForComScoreHiddenEventNotificationWithHandler: return NO; } - // Discard app overlap measurements - NSString *name = labels[@"srg_title"]; - if ([name isEqualToString:@"Installed Apps"]) { - return NO; - } - return handler(event, labels); }]; } diff --git a/docs/README.md b/docs/README.md index 6a5dde28..42d23faa 100644 --- a/docs/README.md +++ b/docs/README.md @@ -41,21 +41,6 @@ The library is made of serveral smaller libraries. Which ones your project must - If you need SRG standard media playback tracking with associated media metadata retrieved by [SRG Data Provider](https://github.com/SRGSSR/srgdataprovider-apple), also link against `SRGAnalyticsDataProvider`. This library provides several playback helpers you should use to ensure that context information is complete when playing a media. - If you are using [SRG Identity](https://github.com/SRGSSR/srgidentity-apple) in your project, also link against `SRGAnalyticsIdentity`. -### Info.plist settings for application installation measurements - -The library automatically tracks which SRG SSR applications are installed on a user device, and sends this information. For this mechanism to work properly, though, your application **must** declare all official SRG SSR application URL schemes as being supported in its `Info.plist` file. - -This can be achieved as follows: - -* Run the `LSApplicationQueriesSchemesGenerator.swift ` script found in the `Scripts` folder. This script automatically generates an `LSApplicationQueriesSchemesGenerator.plist` file in the folder you are running it from, containing an up-to-date list of SRG SSR application schemes. -* Open the generated `plist` file and either copy the `LSApplicationQueriesSchemes` to your project `Info.plist` file, or merge it with already existing entries. - -If URL schemes declared by your application do not match the current ones, application installations will not be accurately reported, and error messages will be logged when the application starts (see _Logging_ below). This situation is not catastropic but should be fixed when possible to ensure better measurements. - -#### Remark - -The number of URL schemes an application declares is limited to 50. Please contact us if your application reaches this limit. - ## Usage When you want to use classes or functions provided by one of the librares in your code, you must import it from your source files first. In Objective-C: diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 93f786bf..dd2adccf 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -26,7 +26,7 @@ platform :ios do clean_result_files clean_derived_data - iphone14 = Device.new('iOS', 'iPhone 15') + iphone14 = Device.new('iOS', 'iPhone 16') appletv = Device.new('tvOS', 'Apple TV') devices = [iphone14, appletv] From 717b59b8d6eb848c2794d6c092d232f00d92491e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20D=C3=A9fago?= Date: Wed, 13 Nov 2024 13:45:37 +0100 Subject: [PATCH 4/5] Remove schemes declared in demo Info.plist (#98) --- Demo/Info.plist | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/Demo/Info.plist b/Demo/Info.plist index 2f27a825..494308f1 100644 --- a/Demo/Info.plist +++ b/Demo/Info.plist @@ -33,34 +33,6 @@ CFBundleVersion $(CURRENT_PROJECT_VERSION) - LSApplicationQueriesSchemes - - srgtraffic - srf - srfsport - srfplayer - srfmeteo - srfradio3 - srfvirus - srfjass - rtsinfo - rtssport - playrts - couleur3 - dtqc3 - rtsradio - rsinews - rsisport - playrsi - rsich - rsiibazaar - rsizerovero - rsipeo - playrtr - ch.swissinfo.news - playswi - tvsvizzera - UIApplicationSceneManifest UIApplicationSupportsMultipleScenes From b606a373a0385079c4ead30262b9b7f0d7ce23f4 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Date: Tue, 3 Dec 2024 15:17:04 +0100 Subject: [PATCH 5/5] Clean import (#99) --- Sources/SRGAnalytics/SRGAnalyticsTracker.m | 1 - 1 file changed, 1 deletion(-) diff --git a/Sources/SRGAnalytics/SRGAnalyticsTracker.m b/Sources/SRGAnalytics/SRGAnalyticsTracker.m index 7d9f8c2f..74b55109 100644 --- a/Sources/SRGAnalytics/SRGAnalyticsTracker.m +++ b/Sources/SRGAnalytics/SRGAnalyticsTracker.m @@ -12,7 +12,6 @@ #import "SRGAnalyticsLabels+Private.h" #import "SRGAnalyticsLogger.h" #import "SRGAnalyticsNotifications+Private.h" -#import "UIViewController+SRGAnalytics.h" @import ComScore; @import TCCore;