diff --git a/Example/Podfile.lock b/Example/Podfile.lock index b81c165..d051d75 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -126,7 +126,6 @@ PODS: - StanwoodAnalytics/Core - StanwoodAnalytics/Fabric - StanwoodAnalytics/Firebase - - StanwoodAnalytics/TestFairy - StanwoodAnalytics/BugFender (1.1.10): - BugfenderSDK (= 1.5) - StanwoodAnalytics/Core @@ -141,8 +140,6 @@ PODS: - StanwoodAnalytics/Mixpanel (1.1.10): - Mixpanel-swift - StanwoodAnalytics/Core - - StanwoodAnalytics/TestFairy (1.1.10): - - StanwoodAnalytics/Core DEPENDENCIES: - Firebase @@ -207,8 +204,8 @@ SPEC CHECKSUMS: Mixpanel-swift: 9118aa461d7ad4bb66718b0d4d826e6487bb0105 nanopb: 18003b5e52dab79db540fe93fe9579f399bd1ccd Protobuf: a4dc852ad69c027ca2166ed287b856697814375b - StanwoodAnalytics: 1daf18bf183376187da16fb571b171cd3e6ff01f + StanwoodAnalytics: 9931e14cb177871374b4636eb629077b07acf6d7 PODFILE CHECKSUM: c4ac65d6342a3acaa0acb7ff0de632e51dcc31b8 -COCOAPODS: 1.8.4 +COCOAPODS: 1.9.3 diff --git a/Example/StanwoodAnalytics/AnalyticsService.swift b/Example/StanwoodAnalytics/AnalyticsService.swift index af43379..b0c82ec 100644 --- a/Example/StanwoodAnalytics/AnalyticsService.swift +++ b/Example/StanwoodAnalytics/AnalyticsService.swift @@ -102,9 +102,6 @@ struct AnalyticsService { #if DEBUG || BETA - let testFairyTracker = TestFairyTracker.TestFairyBuilder(context: application, key: Configuration.Static.Analytics.testFairyKey).build() - analyticsBuilder = analyticsBuilder.add(tracker: testFairyTracker) - #if BF_ENABLED let bugfenderTracker = BugfenderTracker.BugfenderBuilder(context: application, key: bugFenderKey) .setUIEventLogging(enable: true) diff --git a/Example/StanwoodAnalytics/Configuration.swift b/Example/StanwoodAnalytics/Configuration.swift index f5b0ed9..44d4ee0 100644 --- a/Example/StanwoodAnalytics/Configuration.swift +++ b/Example/StanwoodAnalytics/Configuration.swift @@ -11,7 +11,6 @@ import Foundation struct Configuration { struct Static { struct Analytics { - static let testFairyKey = "your-key-here" static let bugFenderKey = "your-key-here" static let googleTrackingKey = "your-key-here" static let mixpanelToken = "your-key-here" diff --git a/Frameworks/libTestFairy.a b/Frameworks/libTestFairy.a deleted file mode 100644 index 7b437a0..0000000 Binary files a/Frameworks/libTestFairy.a and /dev/null differ diff --git a/README.md b/README.md index 3eab381..224e0d2 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,6 @@ The Stanwood Analytics framework is a wrapper to reduce the effort involved in a 1. Fabric [Base] 1. Crashlytics [Base] -1. TestFairy [Base] 1. Firebase Analytics [Base] 1. GoogleAnalytics 1. MixPanel @@ -37,7 +36,7 @@ The Stanwood Analytics framework is a wrapper to reduce the effort involved in a ## Example -Before running the project, it is recommended to register with both Fabric and Firebase Analytics. Optionally register with Google Analytics, Mixpanel, BugFender and TestFairy. Set the keys in the Configuration.swift file. +Before running the project, it is recommended to register with both Fabric and Firebase Analytics. Optionally register with Google Analytics, Mixpanel and BugFender. Set the keys in the Configuration.swift file. To run the example project, clone the repo, and run `pod install` from the Example directory first. @@ -70,7 +69,7 @@ it, add the following line to your Podfile: pod 'StanwoodAnalytics' ``` -This framework has has a base install that by default includes Fabric, Crashlytics, FirebaseAnalytics and TestFairy. Sub specs are defined for BugFender, Google Analytics and Mixpanel. +This framework has has a base install that by default includes Fabric, Crashlytics and FirebaseAnalytics. Sub specs are defined for BugFender, Google Analytics and Mixpanel. ```ruby pod 'StanwoodAnalytics/Mixpanel' @@ -86,8 +85,6 @@ Add the following code into the AppDelegate, or a helper class. Create a tracker ``` -let testFairyKey = "abc123def456" - let fabricTracker = FabricTracker.FabricBuilder(context: application, key: nil).build() let analyticsBuilder = StanwoodAnalytics.builder() @@ -95,8 +92,8 @@ let analyticsBuilder = StanwoodAnalytics.builder() #if DEBUG || STAGE -let testFairyTracker = TestFairyTracker.TestFairyBuilder(context: application, key: testFairyKey).build() -analyticsBuilder = analyticsBuilder.add(tracker: testFairyTracker) +let bugfenderTracker = BugfenderTracker.BugfenderBuilder(context: application, key: bugFenderKey) +analyticsBuilder = analyticsBuilder.add(tracker: bugfenderTracker) #endif @@ -314,7 +311,6 @@ If Fabric and Crashltyics are already in use in a project, it is necessary to re pod 'Firebase/Core' pod 'Firebase/Analytics' pod 'BugfenderSDK' - pod 'TestFairy' pod 'GoogleAnalytics' pod 'Mixpanel' diff --git a/StanwoodAnalytics.podspec b/StanwoodAnalytics.podspec index 33ad504..f760402 100644 --- a/StanwoodAnalytics.podspec +++ b/StanwoodAnalytics.podspec @@ -39,7 +39,6 @@ A framework to encapsulate analytics and logging frameworks from Fabric, Crashly ss.dependency 'StanwoodAnalytics/Core' ss.dependency 'StanwoodAnalytics/Fabric' ss.dependency 'StanwoodAnalytics/Firebase' - ss.dependency 'StanwoodAnalytics/TestFairy' end s.subspec 'Firebase' do |ss| @@ -65,19 +64,6 @@ A framework to encapsulate analytics and logging frameworks from Fabric, Crashly ss.source_files = 'StanwoodAnalytics/Classes/SubSpecs/BugFender/' end - s.subspec 'TestFairy' do |ss| - ss.ios.vendored_library = 'Frameworks/libTestFairy.a' - ss.dependency 'StanwoodAnalytics/Core' - ss.source_files = 'StanwoodAnalytics/Classes/SubSpecs/TestFairy/*.{swift,h,m}' - ss.frameworks = [ - 'CoreMedia', - 'CoreMotion', - 'AVFoundation', - 'SystemConfiguration', - 'OpenGLES' - ] - end - s.subspec 'Mixpanel' do |ss| ss.dependency 'Mixpanel-swift' ss.dependency 'StanwoodAnalytics/Core' diff --git a/StanwoodAnalytics/Classes/SubSpecs/TestFairy/TestFairy.h b/StanwoodAnalytics/Classes/SubSpecs/TestFairy/TestFairy.h deleted file mode 100644 index 9338f0f..0000000 --- a/StanwoodAnalytics/Classes/SubSpecs/TestFairy/TestFairy.h +++ /dev/null @@ -1,245 +0,0 @@ -#import -#import - -#define TF_DEPRECATED(x) __attribute__ ((deprecated(x))) - -@interface TestFairy: NSObject - -/** - * Initialize a TestFairy session. - * - * @param appToken Your key as given to you in your TestFairy account - */ -+ (void)begin:(NSString *)appToken; - -/** - * Initialize a TestFairy session with options. - * - * @param appToken Your key as given to you in your TestFairy account - * @param options A dictionary of options controlling the current session - */ -+ (void)begin:(NSString *)appToken withOptions:(NSDictionary *)options; - -/** - * Change the server endpoint for use with on-premise hosting. Please - * contact support or sales for more information. Must be called before begin - * - * @param serverOverride server address for use with TestFairy - */ -+ (void)setServerEndpoint:(NSString *)serverOverride; - -/** - * Returns SDK version (x.x.x) string - * - * @return version - */ -+ (NSString *)version; - -/** - * Hides a specific view from appearing in the video generated. - * - * @param view The specific view you wish to hide from screenshots - * - */ -+ (void)hideView:(UIView *)view; - -/** - * Hides a specific html element from appearing in your UIWebView - * - * @param selector The specific selector you wish to hide from screenshots. Multiple selectors can be comma separated - */ -+ (void)hideWebViewElements:(NSString *)selector; - -/** - * Pushes the feedback view controller. Hook a button - * to this method to allow users to provide feedback about the current - * session. All feedback will appear in your build report page, and in - * the recorded session page. - * - */ -+ (void)pushFeedbackController; - -/** - * Send a feedback on behalf of the user. Call when using a in-house - * feedback view controller with a custom design and feel. Feedback will - * be associated with the current session. - * - * @param feedbackString Feedback text - */ -+ (void)sendUserFeedback:(NSString *)feedbackString; - -/** - * Proxy didUpdateLocation delegate values and these - * locations will appear in the recorded sessions. Useful for debugging - * actual long/lat values against what the user sees on screen. - * - * @param locations Array of CLLocation. The first object of the array will determine the user location - */ -+ (void)updateLocation:(NSArray *)locations; - -/** - * Marks a checkpoint in session. Use this text to tag a session - * with a checkpoint name. Later you can filter sessions where your - * user passed through this checkpoint, for bettering understanding - * user experience and behavior. - * - * @param name The checkpoint name - */ -+ (void)checkpoint:(NSString *)name; - -/** - * Sets a correlation identifier for this session. This value can - * be looked up via web dashboard. For example, setting correlation - * to the value of the user-id after they logged in. Can be called - * only once per session (subsequent calls will be ignored.) - * - * @param correlationId Id for the current session - */ -+ (void)setCorrelationId:(NSString *)correlationId TF_DEPRECATED("Please refer to setUser:"); - -/** - * Sets a correlation identifier for this session. This value can - * be looked up via web dashboard. For example, setting correlation - * to the value of the user-id after they logged in. Can be called - * only once per session (subsequent calls will be ignored.) - * - * @param correlationId Id for the current session - */ -+ (void)identify:(NSString *)correlationId TF_DEPRECATED("Please refer to setAttribute: and setUser:"); - -/** - * Sets a correlation identifier for this session. This value can - * be looked up via web dashboard. For example, setting correlation - * to the value of the user-id after they logged in. Can be called - * only once per session (subsequent calls will be ignored.) - * - * @param correlationId Id for the current session - * @param traits Attributes and custom attributes to be associated with this session - */ -+ (void)identify:(NSString *)correlationId traits:(NSDictionary *)traits TF_DEPRECATED("Please refer to setAttribute:"); - -/** - * Pauses the current session. This method stops recoding of - * the current session until resume has been called. - * - * @see resume - */ -+ (void)pause; - -/** - * Resumes the recording of the current session. This method - * resumes a session after it was paused. - * - * @see pause - */ -+ (void)resume; - -/** - * Returns the address of the recorded session on testfairy's - * developer portal. Will return nil if recording not yet started. - * - * @return session URL - */ -+ (NSString *)sessionUrl; - -/** - * Takes a screenshot. - * - */ -+ (void)takeScreenshot; - -/** - * Set the name of the current screen. Useful for single page - * applications which use a single UIViewController. - * - * @param name logic name of current screen - */ -+ (void)setScreenName:(NSString *)name; - -/** - * Stops the current session recording. Unlike 'pause', when - * calling 'resume', a new session will be created and will be - * linked to the previous recording. Useful if you want short - * session recordings of specific use-cases of the app. Hidden - * views and user identity will be applied to the new session - * as well, if started. - */ -+ (void)stop; - -/** - * Records a session level attribute which can be looked up via web dashboard. - * - * @param key The name of the attribute. Cannot be nil. - * @param value The value associated with the attribute. Cannot be nil. - * @return YES if successfully set attribute value, NO if failed with error in log. - * - * @note The SDK limits you to storing 64 named attributes. Adding more than 64 will fail and return NO. - */ -+ (BOOL)setAttribute:(NSString *)key withValue:(NSString *)value; - -/** - * Records a user identified as an attribute. We recommend passing values such as - * email, phone number, or user id that your app may use. - * - * @param userId The identifying user. Cannot be nil. - * - */ -+ (void)setUserId:(NSString *)userId; - -/** - * Remote logging. These logs will be sent to the server, - * but will not appear in the console. - */ - -+ (void)log:(NSString *)message; - -/** - * Attach a file to the session. A maximum of 5 files may be attached. Each file cannot be more - * than 15 mb in size. In order to see if the file successfully uploads or fails, please view - * the logs. - * - * @param file path to file on disk. - * - */ -+ (void)attachFile:(NSURL *)file; - -@end - -#if __cplusplus -extern "C" { -#endif - -/** - * Remote logging, use TFLog as you would use printf. These logs will be sent to the server, - * but will not appear in the console. - * - * @param format sprintf-like format for the arguments that follow - */ -void TFLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2))); - -/** - * Remote logging, use TFLogv as you would use printfv. These logs will be sent to the server, - * but will not appear in the console. - * - * @param format sprintf-like format for the arguments that follow - * @param arg_list list of arguments - */ -void TFLogv(NSString *format, va_list arg_list); - -#if __cplusplus -} -#endif - -extern NSString *const TFSDKIdentityTraitNameKey; -extern NSString *const TFSDKIdentityTraitEmailAddressKey; -extern NSString *const TFSDKIdentityTraitBirthdayKey; -extern NSString *const TFSDKIdentityTraitGenderKey; -extern NSString *const TFSDKIdentityTraitPhoneNumberKey; -extern NSString *const TFSDKIdentityTraitWebsiteAddressKey; -extern NSString *const TFSDKIdentityTraitAgeKey; -extern NSString *const TFSDKIdentityTraitSignupDateKey; -extern NSString *const TFSDKEnableCrashReporterKey; -extern NSString *const TestFairyDidShakeDevice; -extern NSString *const TestFairyWillProvideFeedback; -extern NSString *const TestFairyDidCancelFeedback; -extern NSString *const TestFairyDidSendFeedback; diff --git a/StanwoodAnalytics/Classes/SubSpecs/TestFairy/TestFairyDummy.m b/StanwoodAnalytics/Classes/SubSpecs/TestFairy/TestFairyDummy.m deleted file mode 100644 index 7ba1292..0000000 --- a/StanwoodAnalytics/Classes/SubSpecs/TestFairy/TestFairyDummy.m +++ /dev/null @@ -1,8 +0,0 @@ -// -// TestFairyDummy.m -// StanwoodAnalytics.common-TestFairy -// -// Created by Ronan on 28/01/2018. -// - -#import diff --git a/StanwoodAnalytics/Classes/SubSpecs/TestFairy/TestFairyTracker.swift b/StanwoodAnalytics/Classes/SubSpecs/TestFairy/TestFairyTracker.swift deleted file mode 100644 index 4d5690f..0000000 --- a/StanwoodAnalytics/Classes/SubSpecs/TestFairy/TestFairyTracker.swift +++ /dev/null @@ -1,102 +0,0 @@ -// -// TestFairyTracker.swift -// -// The MIT License (MIT) -// -// Copyright (c) 2018 Stanwood GmbH (www.stanwood.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import Foundation - -/// TestFairy Tracker -open class TestFairyTracker: Tracker { - - init(builder: TestFairyBuilder) { - super.init(builder: builder) - - super.checkKey() - - if StanwoodAnalytics.trackingEnabled() == true { - start() - } - } - - open override func start() { - TestFairy.begin(key) - } - - /// Track event. It records eventName, name and itemId. - /// - /// - Parameter trackingParameters: TrackingParameters struct - open override func track(trackingParameters: TrackingParameters) { - let message = "Event: \(String(describing: trackingParameters.eventName)) Name: \(String(describing: trackingParameters.name)) ItemId: \(String(describing: trackingParameters.itemId))" - TestFairy.log(message) - } - - /// Set Tracking - Not implemented. - /// - /// - Parameter enabled: Bool - open override func setTracking(enabled _: Bool) { - // NO-OP - } - - /// Track Error - Not implemented. - /// - /// - Parameter error: NSError - open override func track(error _: NSError) { - // #if DEBUG || BETA - // TFLogv(message, getVaList(args)) - // #endif - } - - /// Track custom parameters. Tracks a user identifier parameter, and ignores all others. - /// - /// - Parameter trackerKeys: TrackerKeys struct - open override func track(trackerKeys: TrackerKeys) { - - for (key, value) in trackerKeys.customKeys where key == StanwoodAnalytics.Keys.identifier { - if let userId = value as? String { - TestFairy.setUserId(userId) - } - } - } - - /// Buiulder for the tracker. - open class TestFairyBuilder: Tracker.Builder { - var uiEventLogging = false - - public override init(context: UIApplication, key: String?) { - super.init(context: context, key: key) - } - - open override func build() -> TestFairyTracker { - return TestFairyTracker(builder: self) - } - - /// Set UI event logging. This is not currently implemented. - /// - /// - Parameter enabled: Bool - /// - Returns: Builder object so that it can be chained. - open func setUIEventLogging(enabled: Bool) -> TestFairyTracker.Builder { - uiEventLogging = enabled - return self - } - } -} diff --git a/StanwoodAnalytics/Classes/SubSpecs/TestFairy/upload-dsym.sh b/StanwoodAnalytics/Classes/SubSpecs/TestFairy/upload-dsym.sh deleted file mode 100644 index d5e4b43..0000000 --- a/StanwoodAnalytics/Classes/SubSpecs/TestFairy/upload-dsym.sh +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/sh - -TESTFAIRY_ENDPOINT="https://app.testfairy.com/upload/dsym/" - -ZIP=zip -CURL=curl -STAT=stat -DATE=date - -log() { - NOW=$($DATE +"%Y-%m-%d %H:%M:%S") - echo "${NOW} ${1}" -} - -help() { - echo "Usage: ${0} [-f] TESTFAIRY_API_KEY [-p DSYM_PATH] [-u TESTFAIRY_ENDPOINT]" - exit 1 -} - -DAEMON=1 -if [ "${1}" == "-f" ]; then - DAEMON=0 - shift -elif [ "${1}" == "-d" ]; then - # backward compatible when -f was the default - shift -fi - - -API_KEY="${1}" -if [ ! "${API_KEY}" ]; then - echo "Fatal: No Upload API key provided." - help -fi - -DSYM_PATH=${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME} - -shift -while [[ $# -gt 1 ]] -do -key="$1" -case $key in - -u) - TESTFAIRY_ENDPOINT="${2}" - shift - ;; - -p) - DSYM_PATH="${2}" - shift - ;; - *) - help - ;; -esac -shift -done - -if [ "${DSYM_PATH}" == "" ] || [ "${DSYM_PATH}" == "/" ] || [ ! -d "${DSYM_PATH}" ]; then - echo "Fatal: No .dSYM folder found at path [${DSYM_PATH}]." - help -fi - -if [[ ${TESTFAIRY_ENDPOINT} == "" ]]; then - echo "Fatal: No upload endpoint given." - help -fi - -NOW=$($DATE +%s) -TMP_FILENAME="/tmp/${NOW}-${DWARF_DSYM_FILE_NAME}.zip" - -# Compress the .dSYM folder into a zip file -log "Compressing .dSYM folder ${DSYM_PATH}" -$ZIP -qrp9 "${TMP_FILENAME}" "${DSYM_PATH}" -FILE_SIZE=$($STAT -f "%z" "${TMP_FILENAME}") - -foreground_upload() { - # Upload zipped .dSYM file to TestFairy's servers - STARTED=$($DATE +"%s") - $CURL -s -F api_key="${API_KEY}" -F dsym=@"${1}" -o /dev/null "${TESTFAIRY_ENDPOINT}" - ENDED=$($DATE +"%s") - DIFF=$(expr ${ENDED} - ${STARTED}) - log "Symbols uploaded in ${DIFF} seconds" - - # Clean up behind - rm -f ${TMP_FILENAME} -} - -background_upload() { - sh -c "$CURL -F api_key=\"${API_KEY}\" -F dsym=@\"${1}\" -s -o /dev/null \"${TESTFAIRY_ENDPOINT}\"; rm -f ${TMP_FILENAME};" /dev/null 2>&1 & -} - -if [ "$DAEMON" == "0" ]; then - log "Uploading ${FILE_SIZE} bytes to dsym server in foreground" - foreground_upload "${TMP_FILENAME}" -else - log "Uploading ${FILE_SIZE} bytes to dsym server in background" - background_upload "${TMP_FILENAME}" -fi - -log "TestFairy .dSYM upload script ends" -