Skip to content

Commit

Permalink
Release v1.7.0 (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
rqbacktrace authored Apr 21, 2021
1 parent da2151c commit ea3e557
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Backtrace.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Pod::Spec.new do |s|

s.name = "Backtrace"
s.version = "1.6.1"
s.version = "1.7.0"
s.summary = "Backtrace's integration with iOS, macOS and tvOS"
s.description = "Reliable crash and hang reporting for iOS, macOS and tvOS."
s.homepage = "https://backtrace.io/"
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Backtrace Cocoa Release Notes

## Version 1.7.0
- Simplifies default file attachments API

## Version 1.6.1
- Allows default file attachments which will be sent for all live reports as well as crash reports
- This allows sending file attachments with crash reports
Expand Down
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,19 +336,18 @@ Set attributes are attached to each report. You can specify unique set of attrib
## Attachments <a name="documentation-attachments"></a>
### For crash reports/all reports <a name="documentation-attachments-all"></a>
You can specify file attachments to be sent with every report (including crash reports). File attachments are specified as a `Dictonary` where the keys are a `String` containing the filename (including the extension), and the values are a `URL` containing the path to the file.
You can specify file attachments to be sent with every report (including crash reports). File attachments are specified as an `Array` of `URL` containing the path to the file.
- Swift
```swift
guard let libraryDirectoryUrl = try? FileManager.default.url(
for: .libraryDirectory, in: .userDomainMask, appropriateFor: nil, create: true) else {
throw CustomError.runtimeError
}
let fileName = "sample.txt"
let fileUrl = libraryDirectoryUrl.appendingPathComponent(fileName)
let fileUrl = libraryDirectoryUrl.appendingPathComponent("sample.txt")
var crashAttachments = Attachments()
crashAttachments[fileName] = fileUrl
crashAttachments.append(fileUrl)
BacktraceClient.shared?.attachments = crashAttachments
```
Expand All @@ -359,12 +358,7 @@ NSURL *libraryUrl = [[[NSFileManager defaultManager] URLsForDirectory:NSLibraryD
inDomains:NSUserDomainMask] lastObject];
NSURL *fileUrl = [libraryUrl URLByAppendingPathComponent:fileName)];

NSArray *attachmentKeys = [NSArray arrayWithObjects:fileName, nil];
NSArray *attachmentObjects = [NSArray arrayWithObjects:fileUrl, nil];
NSDictionary *attachmentDictionary = [NSDictionary dictionaryWithObjects:attachmentObjects
forKeys:attachmentKeys];

BacktraceClient.shared.attachments = attachmentDictionary;
BacktraceClient.shared.attachments = [NSArray arrayWithObjects:fileUrl, nil];
```
### Per Report <a name="documentation-attachments-per-report"></a>
Expand Down

0 comments on commit ea3e557

Please sign in to comment.