Skip to content

Adds support for iOS full stack symbolication #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ or Mac OS X 10.5 and above, and written using Objective-C 2.0 or above.
Requirements
------------

This library uses PLCrashReporter (by Landon Fuller), Apple's Reachability
library, and Peter Hosey's ISO8601DateFormatter library. The latter two are
This library uses PLCrashReporter (by Landon Fuller), Google's GTMLibrary,
(specifically the GTMStringEncoding class), Apple's Reachability
library, and Peter Hosey's ISO8601DateFormatter library. The latter three are
compiled directly into the library. The former is included as a sub-project and
compiled as part of the build process. For iOS, the libCrashReporter static
library is created alongside the libSquashCocoa static library. For Mac OS X,
Expand Down Expand Up @@ -68,8 +69,7 @@ startup, such as your app delegate's
````

The `reportErrors` method loads any errors recorded from previous crashes and
transmits them to Squash. Errors are only removed from this queue when Squash
successfully receives them.
transmits them along with the PLCrashLog to Squash. Errors are only removed from this queue when Squash successfully receives them.

the `hook` method adds the uncaught-exception and default signal handlers that
allow Squash to record new crashes.
Expand Down Expand Up @@ -176,3 +176,6 @@ the LICENSE.txt file under the project directory for more information.

Reachability by Apple, Inc. is distributed under Apple's open-source license.
See the Reachability.h file for more information.

Reachability by Google Inc. is distributed under the Apache license, version 2.0.
See the GTMStringEncoding.h file for more information.
11 changes: 11 additions & 0 deletions Source/SquashCocoa.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#import "PLCrashReporter.h"
#import "PLCrashReport.h"
#import "Reachability.h"
#import "GTMStringEncoding.h"

#if TARGET_OS_MAC && !TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR
#import <ExceptionHandling/ExceptionHandling.h>
#endif
Expand Down Expand Up @@ -180,6 +182,15 @@ - (oneway void) reportErrors {
}

SCOccurrence *occurrence = [[SCOccurrence alloc] initWithCrashReport:report];

// changes in support of squash_ios_crash_log_symbolication ruby gem
// encode PL Crash Log binary into websafe base64 for upload
GTMStringEncoding *webEncoder = [GTMStringEncoding rfc4648Base64WebsafeStringEncoding];
NSString *webEncodedCrashLog = [webEncoder encode:crashData];
NSDictionary *userData = [NSDictionary dictionaryWithObject: webEncodedCrashLog forKey:@"PLCrashLog"];
// add encoded crash log as 'user_data'
occurrence.userData = userData;

NSLog(@"%@ - %@", occurrence, report);
[occurrence report];
[occurrence release];
Expand Down
Loading