diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c37f90..8e8ce0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ * Update gems and migrate to GitHub Actions [#14](https://github.com/polydice/iCook-tvOS/pull/14) * Clean up tracking [#15](https://github.com/polydice/iCook-tvOS/pull/15) * Clean up Fastlane and CI [#16](https://github.com/polydice/iCook-tvOS/pull/16) +* Add ComScore SDK [#17](https://github.com/polydice/iCook-tvOS/pull/17) ## v1.0.0 diff --git a/Makefile b/Makefile index 47bf9bc..9f48014 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ bootstrap: # pod install bundle exec pod keys set BaseAPIURL "https://cdn.jsdelivr.net/gh/polydice/iCook-tvOS@gh-pages/demo/" bundle exec pod keys set FacebookAppID "APP_ID" + bundle exec pod keys set ComScorePublisherID "1000001" bundle exec pod install # mock Google Services plist cp -n mock-GoogleService-Info.plist iCookTV/GoogleService-Info.plist diff --git a/Podfile b/Podfile index 55e9671..da83664 100644 --- a/Podfile +++ b/Podfile @@ -14,6 +14,7 @@ target :iCookTV do pod "Hue", "5.0.0" pod "Kingfisher", "5.7.0" pod "FBSDKTVOSKit" + pod "ComScore" target :iCookTVTests do pod "SwiftLint", '0.34.0' @@ -23,6 +24,6 @@ end plugin "cocoapods-keys", { project: "iCookTV", - keys: ["BaseAPIURL", "FacebookAppID"] + keys: ["BaseAPIURL", "FacebookAppID", "ComScorePublisherID"] } diff --git a/Podfile.lock b/Podfile.lock index ffe69ae..8fb874c 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,5 +1,8 @@ PODS: - Alamofire (4.8.2) + - ComScore (6.3.1): + - ComScore/Dynamic (= 6.3.1) + - ComScore/Dynamic (6.3.1) - FBSDKCoreKit (6.3.0): - FBSDKCoreKit/Basics (= 6.3.0) - FBSDKCoreKit/Core (= 6.3.0) @@ -71,6 +74,7 @@ PODS: DEPENDENCIES: - Alamofire (= 4.8.2) + - ComScore - FBSDKTVOSKit - Firebase/Crashlytics - HCYoutubeParser @@ -82,6 +86,7 @@ DEPENDENCIES: SPEC REPOS: trunk: - Alamofire + - ComScore - FBSDKCoreKit - FBSDKLoginKit - FBSDKShareKit @@ -109,6 +114,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Alamofire: ae5c501addb7afdbb13687d7f2f722c78734c2d3 + ComScore: 2d6206a44c233c08b1f1891e8f138e8f80c07503 FBSDKCoreKit: 5d55c8f3007c9c49b793617b9102e46355fc7e17 FBSDKLoginKit: d46aa04d9bb9990a4deb6441736fae24a8c94496 FBSDKShareKit: cbd309f29d00e596bc28319724a7519940e804fa @@ -131,6 +137,6 @@ SPEC CHECKSUMS: PromisesObjC: c119f3cd559f50b7ae681fa59dc1acd19173b7e6 SwiftLint: 79d48a17c6565dc286c37efb8322c7b450f95c67 -PODFILE CHECKSUM: 9b9fc03aabefe478dda51a4e62057819ca211503 +PODFILE CHECKSUM: e3ad5972da41a88854e69330a4902ec177fe813e COCOAPODS: 1.9.1 diff --git a/iCookTV.xcodeproj/project.pbxproj b/iCookTV.xcodeproj/project.pbxproj index 42167d5..f80dff1 100644 --- a/iCookTV.xcodeproj/project.pbxproj +++ b/iCookTV.xcodeproj/project.pbxproj @@ -379,6 +379,7 @@ B5F7BF461BA9C95F00A75099 /* Resources */, B51A95351CCDFFEB00E5ED97 /* Run Crashlytics Script */, AA754957F6C9D01CFBA353B7 /* [CP] Embed Pods Frameworks */, + 17C2904A7606B8FA298124FF /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -398,6 +399,7 @@ B5F7BF561BA9C95F00A75099 /* Frameworks */, B5F7BF571BA9C95F00A75099 /* Resources */, D98BF45783F7971E01068E78 /* [CP] Embed Pods Frameworks */, + 54944FE815FCB22C2F7808BC /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -474,6 +476,24 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 17C2904A7606B8FA298124FF /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-iCookTV/Pods-iCookTV-resources.sh", + "${PODS_CONFIGURATION_BUILD_DIR}/ComScore/SCORBundle.bundle", + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SCORBundle.bundle", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iCookTV/Pods-iCookTV-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; 24D096314DA4D14E4EDFA5EB /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -492,6 +512,24 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; + 54944FE815FCB22C2F7808BC /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-iCookTV-iCookTVTests/Pods-iCookTV-iCookTVTests-resources.sh", + "${PODS_CONFIGURATION_BUILD_DIR}/ComScore/SCORBundle.bundle", + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SCORBundle.bundle", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iCookTV-iCookTVTests/Pods-iCookTV-iCookTVTests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; 9C2EB9E93A1775F7EBF52165 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -519,6 +557,7 @@ "${PODS_ROOT}/Target Support Files/Pods-iCookTV/Pods-iCookTV-frameworks.sh", "${BUILT_PRODUCTS_DIR}/Keys/Keys.framework", "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", + "${PODS_ROOT}/ComScore/ComScore/dynamic/tvOS/ComScore.framework", "${BUILT_PRODUCTS_DIR}/FBSDKCoreKit/FBSDKCoreKit.framework", "${BUILT_PRODUCTS_DIR}/FBSDKLoginKit/FBSDKLoginKit.framework", "${BUILT_PRODUCTS_DIR}/FBSDKShareKit/FBSDKShareKit.framework", @@ -534,6 +573,7 @@ outputPaths = ( "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Keys.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ComScore.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBSDKCoreKit.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBSDKLoginKit.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBSDKShareKit.framework", @@ -587,6 +627,7 @@ "${PODS_ROOT}/Target Support Files/Pods-iCookTV-iCookTVTests/Pods-iCookTV-iCookTVTests-frameworks.sh", "${BUILT_PRODUCTS_DIR}/Keys/Keys.framework", "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", + "${PODS_ROOT}/ComScore/ComScore/dynamic/tvOS/ComScore.framework", "${BUILT_PRODUCTS_DIR}/FBSDKCoreKit/FBSDKCoreKit.framework", "${BUILT_PRODUCTS_DIR}/FBSDKLoginKit/FBSDKLoginKit.framework", "${BUILT_PRODUCTS_DIR}/FBSDKShareKit/FBSDKShareKit.framework", @@ -602,6 +643,7 @@ outputPaths = ( "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Keys.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ComScore.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBSDKCoreKit.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBSDKLoginKit.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBSDKShareKit.framework", diff --git a/iCookTV/Helpers/Tracker.swift b/iCookTV/Helpers/Tracker.swift index 608c245..64d8f42 100644 --- a/iCookTV/Helpers/Tracker.swift +++ b/iCookTV/Helpers/Tracker.swift @@ -24,6 +24,7 @@ // SOFTWARE. // +import ComScore import FBSDKTVOSKit import Firebase import Foundation @@ -35,6 +36,11 @@ enum Tracker { Settings.appID = iCookTVKeys.FacebookAppID ApplicationDelegate.initializeSDK(nil) FirebaseApp.configure() + let comScoreConfiguration = SCORPublisherConfiguration { (configurationBuilder) in + configurationBuilder?.publisherId = iCookTVKeys.ComScorePublisherID + } + SCORAnalytics.configuration().addClient(with: comScoreConfiguration) + SCORAnalytics.start() #endif } diff --git a/iCookTV/iCookTVKeys.swift b/iCookTV/iCookTVKeys.swift index 5a2395e..b7dfdef 100644 --- a/iCookTV/iCookTVKeys.swift +++ b/iCookTV/iCookTVKeys.swift @@ -34,4 +34,11 @@ struct iCookTVKeys { ICookTVKeys().baseAPIURL }() + static let FacebookAppID: String = { + ICookTVKeys().facebookAppID + }() + + static let ComScorePublisherID: String = { + ICookTVKeys().comScorePublisherID + }() }