Merge lp:~rockstar/ubuntuone-ios-music/crashlytics into lp:ubuntuone-ios-music

Proposed by Paul Hummer
Status: Merged
Approved by: Paul Hummer
Approved revision: 247
Merged at revision: 247
Proposed branch: lp:~rockstar/ubuntuone-ios-music/crashlytics
Merge into: lp:ubuntuone-ios-music
Diff against target: 370 lines (+266/-0)
4 files modified
Crashlytics.framework/Versions/A/Headers/Crashlytics.h (+192/-0)
Crashlytics.framework/Versions/A/Resources/Info.plist (+46/-0)
Music/UOAppDelegate.m (+2/-0)
U1Music.xcodeproj/project.pbxproj (+26/-0)
To merge this branch: bzr merge lp:~rockstar/ubuntuone-ios-music/crashlytics
Reviewer Review Type Date Requested Status
Mike McCracken (community) Approve
Review via email: mp+147422@code.launchpad.net

Commit message

Add Crashlytics reporting

Description of the change

It's my day off, but I just got in on the Crashlytics crash reporting beta, and after installing it in the app I wanted to try it out on, I immediately created a Canonical organization and added to U1 Music. This is the change to actually use it.

To post a comment you must log in.
247. By Paul Hummer

Add crashlytics

Duh. You have to commit before you push and submit for merge, dummkopf

Revision history for this message
Mike McCracken (mikemc) wrote :

Looks good to me on visual inspection.

LulZ!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'Crashlytics.framework'
2=== added symlink 'Crashlytics.framework/Crashlytics'
3=== target is u'Versions/Current/Crashlytics'
4=== added symlink 'Crashlytics.framework/Headers'
5=== target is u'Versions/Current/Headers'
6=== added symlink 'Crashlytics.framework/Resources'
7=== target is u'Versions/Current/Resources'
8=== added directory 'Crashlytics.framework/Versions'
9=== added directory 'Crashlytics.framework/Versions/A'
10=== added file 'Crashlytics.framework/Versions/A/Crashlytics'
11Binary files Crashlytics.framework/Versions/A/Crashlytics 1970-01-01 00:00:00 +0000 and Crashlytics.framework/Versions/A/Crashlytics 2013-02-08 17:07:26 +0000 differ
12=== added directory 'Crashlytics.framework/Versions/A/Headers'
13=== added file 'Crashlytics.framework/Versions/A/Headers/Crashlytics.h'
14--- Crashlytics.framework/Versions/A/Headers/Crashlytics.h 1970-01-01 00:00:00 +0000
15+++ Crashlytics.framework/Versions/A/Headers/Crashlytics.h 2013-02-08 17:07:26 +0000
16@@ -0,0 +1,192 @@
17+//
18+// Crashlytics.h
19+// Crashlytics
20+//
21+// Copyright 2012 Crashlytics, Inc. All rights reserved.
22+//
23+
24+#import <Foundation/Foundation.h>
25+
26+/**
27+ *
28+ * The CLS_LOG macro provides as easy way to gather more information in your log messages that are
29+ * sent with your crash data. CLS_LOG prepends your custom log message with the function name and
30+ * line number where the macro was used. If your app was built with the DEBUG preprocessor macro
31+ * defined CLS_LOG uses the CLSNSLog function which forwards your log message to NSLog and CLSLog.
32+ * If the DEBUG preprocessor macro is not defined CLS_LOG uses CLSLog only.
33+ *
34+ * Example output:
35+ * -[AppDelegate login:] line 134 $ login start
36+ *
37+ * If you would like to change this macro, create a new header file, unset our define and then define
38+ * your own version. Make sure this new header file is imported after the Crashlytics header file.
39+ *
40+ * #undef CLS_LOG
41+ * #define CLS_LOG(__FORMAT__, ...) CLSNSLog...
42+ *
43+ **/
44+#ifdef DEBUG
45+#define CLS_LOG(__FORMAT__, ...) CLSNSLog((@"%s line %d $ " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
46+#else
47+#define CLS_LOG(__FORMAT__, ...) CLSLog((@"%s line %d $ " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
48+#endif
49+
50+/**
51+ *
52+ * Add logging that will be sent with your crash data. This logging will not show up in the system.log
53+ * and will only be visible in your Crashlytics dashboard.
54+ *
55+ **/
56+OBJC_EXTERN void CLSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2);
57+
58+/**
59+ *
60+ * Add logging that will be sent with your crash data. This logging will show up in the system.log
61+ * and your Crashlytics dashboard. It is not recommended for Release builds.
62+ *
63+ **/
64+OBJC_EXTERN void CLSNSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2);
65+
66+@protocol CrashlyticsDelegate;
67+
68+@interface Crashlytics : NSObject
69+
70+@property (nonatomic, readonly, copy) NSString *apiKey;
71+@property (nonatomic, readonly, copy) NSString *version;
72+@property (nonatomic, assign) BOOL debugMode;
73+
74+@property (nonatomic, assign) NSObject <CrashlyticsDelegate> *delegate;
75+
76+/**
77+ *
78+ * The recommended way to install Crashlytics into your application is to place a call
79+ * to +startWithAPIKey: in your -application:didFinishLaunchingWithOptions: method.
80+ *
81+ * This delay defaults to 1 second in order to generally give the application time to
82+ * fully finish launching.
83+ *
84+ **/
85++ (Crashlytics *)startWithAPIKey:(NSString *)apiKey;
86++ (Crashlytics *)startWithAPIKey:(NSString *)apiKey afterDelay:(NSTimeInterval)delay;
87+
88+/**
89+ *
90+ * If you need the functionality provided by the CrashlyticsDelegate protocol, you can use
91+ * these convenience methods to activate the framework and set the delegate in one call.
92+ *
93+ **/
94++ (Crashlytics *)startWithAPIKey:(NSString *)apiKey delegate:(NSObject <CrashlyticsDelegate> *)delegate;
95++ (Crashlytics *)startWithAPIKey:(NSString *)apiKey delegate:(NSObject <CrashlyticsDelegate> *)delegate afterDelay:(NSTimeInterval)delay;
96+
97+/**
98+ *
99+ * Access the singleton Crashlytics instance.
100+ *
101+ **/
102++ (Crashlytics *)sharedInstance;
103+
104+/**
105+ *
106+ * The easiest way to cause a crash - great for testing!
107+ *
108+ **/
109+- (void)crash;
110+
111+/**
112+ *
113+ * Many of our customers have requested the ability to tie crashes to specific end-users of their
114+ * application in order to facilitate responses to support requests or permit the ability to reach
115+ * out for more information. We allow you to specify up to three separate values for display within
116+ * the Crashlytics UI - but please be mindful of your end-user's privacy.
117+ *
118+ * We recommend specifying a user identifier - an arbitrary string that ties an end-user to a record
119+ * in your system. This could be a database id, hash, or other value that is meaningless to a
120+ * third-party observer but can be indexed and queried by you.
121+ *
122+ * Optionally, you may also specify the end-user's name or username, as well as email address if you
123+ * do not have a system that works well with obscured identifiers.
124+ *
125+ * Pursuant to our EULA, this data is transferred securely throughout our system and we will not
126+ * disseminate end-user data unless required to by law. That said, if you choose to provide end-user
127+ * contact information, we strongly recommend that you disclose this in your application's privacy
128+ * policy. Data privacy is of our utmost concern.
129+ *
130+ **/
131+- (void)setUserIdentifier:(NSString *)identifier;
132+- (void)setUserName:(NSString *)name;
133+- (void)setUserEmail:(NSString *)email;
134+
135++ (void)setUserIdentifier:(NSString *)identifier;
136++ (void)setUserName:(NSString *)name;
137++ (void)setUserEmail:(NSString *)email;
138+
139+/**
140+ *
141+ * Set a value for a key to be associated with your crash data.
142+ *
143+ **/
144+- (void)setObjectValue:(id)value forKey:(NSString *)key;
145+- (void)setIntValue:(int)value forKey:(NSString *)key;
146+- (void)setBoolValue:(BOOL)value forKey:(NSString *)key;
147+- (void)setFloatValue:(float)value forKey:(NSString *)key;
148+
149++ (void)setObjectValue:(id)value forKey:(NSString *)key;
150++ (void)setIntValue:(int)value forKey:(NSString *)key;
151++ (void)setBoolValue:(BOOL)value forKey:(NSString *)key;
152++ (void)setFloatValue:(float)value forKey:(NSString *)key;
153+
154+@end
155+
156+/**
157+ * The CLSCrashReport protocol exposes methods that you can call on crash report objects passed
158+ * to delegate methods. If you want these values or the entire object to stay in memory retain
159+ * them or copy them.
160+ **/
161+@protocol CLSCrashReport <NSObject>
162+@required
163+
164+/**
165+ * Returns the session identifier for the crash report.
166+ **/
167+- (NSString *)identifier;
168+
169+/**
170+ * Returns the custom key value data for the crash report.
171+ **/
172+- (NSDictionary *)customKeys;
173+
174+@end
175+
176+/**
177+ *
178+ * The CrashlyticsDelegate protocol provides a mechanism for your application to take
179+ * action on events that occur in the Crashlytics crash reporting system. You can make
180+ * use of these calls by assigning an object to the Crashlytics' delegate property directly,
181+ * or through the convenience startWithAPIKey:delegate:... methods.
182+ *
183+ **/
184+@protocol CrashlyticsDelegate <NSObject>
185+@optional
186+
187+/**
188+ *
189+ * Called once a Crashlytics instance has determined that the last execution of the
190+ * application ended in a crash. This is called some time after the crash reporting
191+ * process has begun. If you have specified a delay in one of the
192+ * startWithAPIKey:... calls, this will take at least that long to be invoked.
193+ *
194+ **/
195+- (void)crashlyticsDidDetectCrashDuringPreviousExecution:(Crashlytics *)crashlytics;
196+
197+/**
198+ *
199+ * Just like crashlyticsDidDetectCrashDuringPreviousExecution this delegate method is
200+ * called once a Crashlytics instance has determined that the last execution of the
201+ * application ended in a crash. A CLSCrashReport is passed back that contains data about
202+ * the last crash report that was generated. See the CLSCrashReport protocol for method details.
203+ * This method is called after crashlyticsDidDetectCrashDuringPreviousExecution.
204+ *
205+ **/
206+- (void)crashlytics:(Crashlytics *)crashlytics didDetectCrashDuringPreviousExecution:(id <CLSCrashReport>)crash;
207+
208+@end
209
210=== added directory 'Crashlytics.framework/Versions/A/Resources'
211=== added file 'Crashlytics.framework/Versions/A/Resources/Info.plist'
212--- Crashlytics.framework/Versions/A/Resources/Info.plist 1970-01-01 00:00:00 +0000
213+++ Crashlytics.framework/Versions/A/Resources/Info.plist 2013-02-08 17:07:26 +0000
214@@ -0,0 +1,46 @@
215+<?xml version="1.0" encoding="UTF-8"?>
216+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
217+<plist version="1.0">
218+<dict>
219+ <key>BuildMachineOSBuild</key>
220+ <string>12C60</string>
221+ <key>CFBundleDevelopmentRegion</key>
222+ <string>English</string>
223+ <key>CFBundleExecutable</key>
224+ <string>Crashlytics</string>
225+ <key>CFBundleIdentifier</key>
226+ <string>com.crashlytics.ios</string>
227+ <key>CFBundleInfoDictionaryVersion</key>
228+ <string>6.0</string>
229+ <key>CFBundleName</key>
230+ <string>Crashlytics</string>
231+ <key>CFBundlePackageType</key>
232+ <string>FMWK</string>
233+ <key>CFBundleShortVersionString</key>
234+ <string>2.0.3</string>
235+ <key>CFBundleSupportedPlatforms</key>
236+ <array>
237+ <string>iPhoneOS</string>
238+ </array>
239+ <key>CFBundleVersion</key>
240+ <string>0200.03.00</string>
241+ <key>DTCompiler</key>
242+ <string>com.apple.compilers.llvm.clang.1_0</string>
243+ <key>DTPlatformBuild</key>
244+ <string>10A403</string>
245+ <key>DTPlatformName</key>
246+ <string>iphoneos</string>
247+ <key>DTPlatformVersion</key>
248+ <string>6.0</string>
249+ <key>DTSDKBuild</key>
250+ <string>10A403</string>
251+ <key>DTSDKName</key>
252+ <string>iphoneos6.0</string>
253+ <key>DTXcode</key>
254+ <string>0451</string>
255+ <key>DTXcodeBuild</key>
256+ <string>4G1004</string>
257+ <key>MinimumOSVersion</key>
258+ <string>4.0</string>
259+</dict>
260+</plist>
261
262=== added symlink 'Crashlytics.framework/Versions/Current'
263=== target is u'A'
264=== added file 'Crashlytics.framework/run'
265Binary files Crashlytics.framework/run 1970-01-01 00:00:00 +0000 and Crashlytics.framework/run 2013-02-08 17:07:26 +0000 differ
266=== modified file 'Music/UOAppDelegate.m'
267--- Music/UOAppDelegate.m 2013-01-27 21:34:28 +0000
268+++ Music/UOAppDelegate.m 2013-02-08 17:07:26 +0000
269@@ -32,6 +32,7 @@
270 #import "UOAuthManager.h"
271 #import "U1LocalMusicServer.h"
272 #import "StreamingPlayer.h"
273+#import <Crashlytics/Crashlytics.h>
274
275 #if TARGET_IPHONE_SIMULATOR
276 @implementation NSURLRequest(AllowAllCerts)
277@@ -54,6 +55,7 @@
278 @synthesize musicServer = _musicServer;
279
280 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions {
281+ [Crashlytics startWithAPIKey:@"0606692bafe724ed1413548f6211a8557140eade"];
282
283 self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds ]];
284
285
286=== modified file 'U1Music.xcodeproj/project.pbxproj'
287--- U1Music.xcodeproj/project.pbxproj 2013-01-30 20:07:42 +0000
288+++ U1Music.xcodeproj/project.pbxproj 2013-02-08 17:07:26 +0000
289@@ -28,6 +28,7 @@
290 523B3CFA15B73BA0004394F4 /* download-grey@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 523B3CF615B73BA0004394F4 /* download-grey@2x.png */; };
291 523B3CFB15B73BA0004394F4 /* download.png in Resources */ = {isa = PBXBuildFile; fileRef = 523B3CF715B73BA0004394F4 /* download.png */; };
292 523B3CFC15B73BA0004394F4 /* download@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 523B3CF815B73BA0004394F4 /* download@2x.png */; };
293+ 5257416D16C5653100530CCC /* Crashlytics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5257416C16C5653100530CCC /* Crashlytics.framework */; };
294 5268509716AE5267001F65A6 /* libRestKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5268509016AE516C001F65A6 /* libRestKit.a */; };
295 526850A816AEE4E1001F65A6 /* Storyboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 526850A516AEE4E1001F65A6 /* Storyboard_iPhone.storyboard */; };
296 526850A916AEE4E1001F65A6 /* UOAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 526850A716AEE4E1001F65A6 /* UOAppDelegate.m */; };
297@@ -270,6 +271,7 @@
298 523B3CF615B73BA0004394F4 /* download-grey@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "download-grey@2x.png"; sourceTree = "<group>"; };
299 523B3CF715B73BA0004394F4 /* download.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = download.png; sourceTree = "<group>"; };
300 523B3CF815B73BA0004394F4 /* download@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "download@2x.png"; sourceTree = "<group>"; };
301+ 5257416C16C5653100530CCC /* Crashlytics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Crashlytics.framework; sourceTree = "<group>"; };
302 5268508516AE516B001F65A6 /* RestKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RestKit.xcodeproj; path = ../RestKit/RestKit.xcodeproj; sourceTree = "<group>"; };
303 526850A516AEE4E1001F65A6 /* Storyboard_iPhone.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Storyboard_iPhone.storyboard; sourceTree = "<group>"; };
304 526850A616AEE4E1001F65A6 /* UOAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UOAppDelegate.h; sourceTree = "<group>"; };
305@@ -615,6 +617,7 @@
306 9132827D144E07EA00395F40 /* libTestFlight.a in Frameworks */,
307 5268509716AE5267001F65A6 /* libRestKit.a in Frameworks */,
308 52E7F4A316AF1522003A46DA /* UbuntuOneAuthKit.a in Frameworks */,
309+ 5257416D16C5653100530CCC /* Crashlytics.framework in Frameworks */,
310 );
311 runOnlyForDeploymentPostprocessing = 0;
312 };
313@@ -664,6 +667,7 @@
314 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
315 isa = PBXGroup;
316 children = (
317+ 5257416C16C5653100530CCC /* Crashlytics.framework */,
318 5268510716AEFD20001F65A6 /* MobileCoreServices.framework */,
319 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
320 1D30AB110D05D00D00671497 /* Foundation.framework */,
321@@ -1281,6 +1285,7 @@
322 913A54A81450C1310081FD67 /* Run Script */,
323 1D60588D0D05DD3D006BFB54 /* Resources */,
324 5297671616B70D6A00A40EDB /* ShellScript */,
325+ 5257416616C5650900530CCC /* ShellScript */,
326 );
327 buildRules = (
328 );
329@@ -1466,6 +1471,19 @@
330 /* End PBXResourcesBuildPhase section */
331
332 /* Begin PBXShellScriptBuildPhase section */
333+ 5257416616C5650900530CCC /* ShellScript */ = {
334+ isa = PBXShellScriptBuildPhase;
335+ buildActionMask = 2147483647;
336+ files = (
337+ );
338+ inputPaths = (
339+ );
340+ outputPaths = (
341+ );
342+ runOnlyForDeploymentPostprocessing = 0;
343+ shellPath = /bin/sh;
344+ shellScript = "./Crashlytics.framework/run 0606692bafe724ed1413548f6211a8557140eade";
345+ };
346 5297671616B70D6A00A40EDB /* ShellScript */ = {
347 isa = PBXShellScriptBuildPhase;
348 buildActionMask = 2147483647;
349@@ -1615,6 +1633,10 @@
350 "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
351 COPY_PHASE_STRIP = NO;
352 CURRENT_PROJECT_VERSION = 6;
353+ FRAMEWORK_SEARCH_PATHS = (
354+ "$(inherited)",
355+ "\"$(SRCROOT)\"",
356+ );
357 GCC_DYNAMIC_NO_PIC = NO;
358 GCC_OPTIMIZATION_LEVEL = 0;
359 GCC_PRECOMPILE_PREFIX_HEADER = YES;
360@@ -1653,6 +1675,10 @@
361 "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
362 COPY_PHASE_STRIP = NO;
363 CURRENT_PROJECT_VERSION = 6;
364+ FRAMEWORK_SEARCH_PATHS = (
365+ "$(inherited)",
366+ "\"$(SRCROOT)\"",
367+ );
368 GCC_PRECOMPILE_PREFIX_HEADER = YES;
369 GCC_PREFIX_HEADER = U1Music_Prefix.pch;
370 GCC_THUMB_SUPPORT = NO;

Subscribers

People subscribed via source and target branches