Skip to content

Commit

Permalink
Add Crashlytics. Remove Hockey and Flurry
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissloey committed Nov 19, 2014
1 parent 6cafcbd commit 28c5c02
Show file tree
Hide file tree
Showing 33 changed files with 347 additions and 121 deletions.
1 change: 1 addition & 0 deletions Crashlytics.framework/Crashlytics
1 change: 1 addition & 0 deletions Crashlytics.framework/Headers
6 changes: 6 additions & 0 deletions Crashlytics.framework/Modules/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
framework module Crashlytics {
umbrella header "Crashlytics.h"

export *
module * { export * }
}
1 change: 1 addition & 0 deletions Crashlytics.framework/Resources
Binary file added Crashlytics.framework/Versions/A/Crashlytics
Binary file not shown.
220 changes: 220 additions & 0 deletions Crashlytics.framework/Versions/A/Headers/Crashlytics.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
//
// Crashlytics.h
// Crashlytics
//
// Copyright 2013 Crashlytics, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>

/**
*
* The CLS_LOG macro provides as easy way to gather more information in your log messages that are
* sent with your crash data. CLS_LOG prepends your custom log message with the function name and
* line number where the macro was used. If your app was built with the DEBUG preprocessor macro
* defined CLS_LOG uses the CLSNSLog function which forwards your log message to NSLog and CLSLog.
* If the DEBUG preprocessor macro is not defined CLS_LOG uses CLSLog only.
*
* Example output:
* -[AppDelegate login:] line 134 $ login start
*
* If you would like to change this macro, create a new header file, unset our define and then define
* your own version. Make sure this new header file is imported after the Crashlytics header file.
*
* #undef CLS_LOG
* #define CLS_LOG(__FORMAT__, ...) CLSNSLog...
*
**/
#ifdef DEBUG
#define CLS_LOG(__FORMAT__, ...) CLSNSLog((@"%s line %d $ " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#define CLS_LOG(__FORMAT__, ...) CLSLog((@"%s line %d $ " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#endif

/**
*
* Add logging that will be sent with your crash data. This logging will not show up in the system.log
* and will only be visible in your Crashlytics dashboard.
*
**/
OBJC_EXTERN void CLSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2);
OBJC_EXTERN void CLSLogv(NSString *format, va_list args) NS_FORMAT_FUNCTION(1,0);

/**
*
* Add logging that will be sent with your crash data. This logging will show up in the system.log
* and your Crashlytics dashboard. It is not recommended for Release builds.
*
**/
OBJC_EXTERN void CLSNSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2);
OBJC_EXTERN void CLSNSLogv(NSString *format, va_list args) NS_FORMAT_FUNCTION(1,0);


@protocol CrashlyticsDelegate;

@interface Crashlytics : NSObject

@property (nonatomic, readonly, copy) NSString *apiKey;
@property (nonatomic, readonly, copy) NSString *version;
@property (nonatomic, assign) BOOL debugMode;

@property (nonatomic, assign) NSObject <CrashlyticsDelegate> *delegate;

/**
*
* The recommended way to install Crashlytics into your application is to place a call
* to +startWithAPIKey: in your -application:didFinishLaunchingWithOptions: method.
*
* This delay defaults to 1 second in order to generally give the application time to
* fully finish launching.
*
**/
+ (Crashlytics *)startWithAPIKey:(NSString *)apiKey;
+ (Crashlytics *)startWithAPIKey:(NSString *)apiKey afterDelay:(NSTimeInterval)delay;

/**
*
* If you need the functionality provided by the CrashlyticsDelegate protocol, you can use
* these convenience methods to activate the framework and set the delegate in one call.
*
**/
+ (Crashlytics *)startWithAPIKey:(NSString *)apiKey delegate:(NSObject <CrashlyticsDelegate> *)delegate;
+ (Crashlytics *)startWithAPIKey:(NSString *)apiKey delegate:(NSObject <CrashlyticsDelegate> *)delegate afterDelay:(NSTimeInterval)delay;

/**
*
* Access the singleton Crashlytics instance.
*
**/
+ (Crashlytics *)sharedInstance;

/**
*
* The easiest way to cause a crash - great for testing!
*
**/
- (void)crash;

/**
*
* Many of our customers have requested the ability to tie crashes to specific end-users of their
* application in order to facilitate responses to support requests or permit the ability to reach
* out for more information. We allow you to specify up to three separate values for display within
* the Crashlytics UI - but please be mindful of your end-user's privacy.
*
* We recommend specifying a user identifier - an arbitrary string that ties an end-user to a record
* in your system. This could be a database id, hash, or other value that is meaningless to a
* third-party observer but can be indexed and queried by you.
*
* Optionally, you may also specify the end-user's name or username, as well as email address if you
* do not have a system that works well with obscured identifiers.
*
* Pursuant to our EULA, this data is transferred securely throughout our system and we will not
* disseminate end-user data unless required to by law. That said, if you choose to provide end-user
* contact information, we strongly recommend that you disclose this in your application's privacy
* policy. Data privacy is of our utmost concern.
*
**/
- (void)setUserIdentifier:(NSString *)identifier;
- (void)setUserName:(NSString *)name;
- (void)setUserEmail:(NSString *)email;

+ (void)setUserIdentifier:(NSString *)identifier;
+ (void)setUserName:(NSString *)name;
+ (void)setUserEmail:(NSString *)email;

/**
*
* Set a value for a key to be associated with your crash data.
*
**/
- (void)setObjectValue:(id)value forKey:(NSString *)key;
- (void)setIntValue:(int)value forKey:(NSString *)key;
- (void)setBoolValue:(BOOL)value forKey:(NSString *)key;
- (void)setFloatValue:(float)value forKey:(NSString *)key;

+ (void)setObjectValue:(id)value forKey:(NSString *)key;
+ (void)setIntValue:(int)value forKey:(NSString *)key;
+ (void)setBoolValue:(BOOL)value forKey:(NSString *)key;
+ (void)setFloatValue:(float)value forKey:(NSString *)key;

@end

/**
* The CLSCrashReport protocol exposes methods that you can call on crash report objects passed
* to delegate methods. If you want these values or the entire object to stay in memory retain
* them or copy them.
**/
@protocol CLSCrashReport <NSObject>
@required

/**
* Returns the session identifier for the crash report.
**/
@property (nonatomic, readonly) NSString *identifier;

/**
* Returns the custom key value data for the crash report.
**/
@property (nonatomic, readonly) NSDictionary *customKeys;

/**
* Returns the CFBundleVersion of the application that crashed.
**/
@property (nonatomic, readonly) NSString *bundleVersion;

/**
* Returns the CFBundleShortVersionString of the application that crashed.
**/
@property (nonatomic, readonly) NSString *bundleShortVersionString;

/**
* Returns the date that the application crashed at.
**/
@property (nonatomic, readonly) NSDate *crashedOnDate;

/**
* Returns the os version that the application crashed on.
**/
@property (nonatomic, readonly) NSString *OSVersion;

/**
* Returns the os build version that the application crashed on.
**/
@property (nonatomic, readonly) NSString *OSBuildVersion;

@end

/**
*
* The CrashlyticsDelegate protocol provides a mechanism for your application to take
* action on events that occur in the Crashlytics crash reporting system. You can make
* use of these calls by assigning an object to the Crashlytics' delegate property directly,
* or through the convenience startWithAPIKey:delegate:... methods.
*
**/
@protocol CrashlyticsDelegate <NSObject>
@optional

/**
*
* Called once a Crashlytics instance has determined that the last execution of the
* application ended in a crash. This is called some time after the crash reporting
* process has begun. If you have specified a delay in one of the
* startWithAPIKey:... calls, this will take at least that long to be invoked.
*
**/
- (void)crashlyticsDidDetectCrashDuringPreviousExecution:(Crashlytics *)crashlytics;

/**
*
* Just like crashlyticsDidDetectCrashDuringPreviousExecution this delegate method is
* called once a Crashlytics instance has determined that the last execution of the
* application ended in a crash. A CLSCrashReport is passed back that contains data about
* the last crash report that was generated. See the CLSCrashReport protocol for method details.
* This method is called after crashlyticsDidDetectCrashDuringPreviousExecution.
*
**/
- (void)crashlytics:(Crashlytics *)crashlytics didDetectCrashDuringPreviousExecution:(id <CLSCrashReport>)crash;

@end
30 changes: 30 additions & 0 deletions Crashlytics.framework/Versions/A/Resources/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Crashlytics</string>
<key>CFBundleIdentifier</key>
<string>com.crashlytics.ios</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Crashlytics</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.2.5</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>iPhoneOS</string>
</array>
<key>CFBundleVersion</key>
<string>40</string>
<key>DTPlatformName</key>
<string>iphoneos</string>
<key>MinimumOSVersion</key>
<string>4.0</string>
</dict>
</plist>
1 change: 1 addition & 0 deletions Crashlytics.framework/Versions/Current
Binary file added Crashlytics.framework/run
Binary file not shown.
Binary file added Crashlytics.framework/submit
Binary file not shown.
28 changes: 28 additions & 0 deletions Glasgow Cycling.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
125D7ED319339AD200187A17 /* JCCycleMapLocationViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 125D7ED219339AD200187A17 /* JCCycleMapLocationViewModel.m */; };
129BE686191BC3DE0021437F /* JCPathViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 129BE685191BC3DE0021437F /* JCPathViewModel.m */; };
129BE689191BC5470021437F /* JCCaptureViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 129BE688191BC5470021437F /* JCCaptureViewModel.m */; };
129D9C111A1CE4C100F89C05 /* Crashlytics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 129D9C101A1CE4C100F89C05 /* Crashlytics.framework */; };
12A9C26D190FAB8C004BB4B5 /* UIColor+Application.m in Sources */ = {isa = PBXBuildFile; fileRef = 12A9C26C190FAB8C004BB4B5 /* UIColor+Application.m */; };
12AABA36192C9D51005DE6AC /* JCStatViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 12AABA35192C9D51005DE6AC /* JCStatViewModel.m */; };
12AABA39192CABE2005DE6AC /* JCGraphScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 12AABA38192CABE2005DE6AC /* JCGraphScrollView.m */; };
Expand Down Expand Up @@ -158,6 +159,7 @@
129BE685191BC3DE0021437F /* JCPathViewModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JCPathViewModel.m; sourceTree = "<group>"; };
129BE687191BC5470021437F /* JCCaptureViewModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JCCaptureViewModel.h; sourceTree = "<group>"; };
129BE688191BC5470021437F /* JCCaptureViewModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JCCaptureViewModel.m; sourceTree = "<group>"; };
129D9C101A1CE4C100F89C05 /* Crashlytics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Crashlytics.framework; sourceTree = "<group>"; };
12A9C26B190FAB8C004BB4B5 /* UIColor+Application.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+Application.h"; sourceTree = "<group>"; };
12A9C26C190FAB8C004BB4B5 /* UIColor+Application.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+Application.m"; sourceTree = "<group>"; };
12AABA34192C9D51005DE6AC /* JCStatViewModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JCStatViewModel.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -311,6 +313,7 @@
831EDB4E18BCBB33001468E4 /* UIKit.framework in Frameworks */,
831EDB4A18BCBB33001468E4 /* Foundation.framework in Frameworks */,
EA1572DE908A4ADA8D403842 /* libPods.a in Frameworks */,
129D9C111A1CE4C100F89C05 /* Crashlytics.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -544,6 +547,7 @@
831EDB4818BCBB33001468E4 /* Frameworks */ = {
isa = PBXGroup;
children = (
129D9C101A1CE4C100F89C05 /* Crashlytics.framework */,
12D5CEE319D1AF29001EA9FB /* libPods.a */,
83735C0318CF730C0050AB09 /* CoreLocation.framework */,
83C1DB1918C7856C0005F79C /* MobileCoreServices.framework */,
Expand Down Expand Up @@ -824,6 +828,7 @@
831EDB4318BCBB33001468E4 /* Frameworks */,
831EDB4418BCBB33001468E4 /* Resources */,
78FDD1B960064994842C1C74 /* Copy Pods Resources */,
120E01901A1CC1FE0045B40D /* ShellScript */,
);
buildRules = (
);
Expand Down Expand Up @@ -920,6 +925,19 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
120E01901A1CC1FE0045B40D /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "./Crashlytics.framework/run bfe078d6ca5ea6f9689b7a5b694662ca3ebda224 2516c71973de20e76534ec3156a02959da2582578c6b6661b16a3a7421c2d6af";
};
4E988E07F883430BBCFCBA33 /* Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -1188,6 +1206,11 @@
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
"$(PROJECT_DIR)/Pods/CrashlyticsFramework",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "JourneyCapture/Support/Glasgow Cycling-Prefix.pch";
INFOPLIST_FILE = "JourneyCapture/Support/Glasgow Cycling-Info.plist";
Expand All @@ -1206,6 +1229,11 @@
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
"$(PROJECT_DIR)/Pods/CrashlyticsFramework",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "JourneyCapture/Support/Glasgow Cycling-Prefix.pch";
INFOPLIST_FILE = "JourneyCapture/Support/Glasgow Cycling-Info.plist";
Expand Down
3 changes: 1 addition & 2 deletions JourneyCapture/Application/JCAppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
//

#import <UIKit/UIKit.h>
#import <HockeySDK/HockeySDK.h>

@interface JCAppDelegate : UIResponder <UIApplicationDelegate, BITHockeyManagerDelegate>
@interface JCAppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

Expand Down
Loading

0 comments on commit 28c5c02

Please sign in to comment.