This repository has been archived by the owner on Dec 14, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
586b98e
commit af919c2
Showing
8 changed files
with
110 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
echo "Setting SentryDSN to $SENTRY_DSN" | ||
/usr/libexec/PlistBuddy -c "Set SentryDSN $SENTRY_DSN" "lockbox-ios/Common/Resources/Info.plist" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
import Foundation | ||
import Sentry | ||
|
||
class Sentry { | ||
private let SentryDSNKey = "SentryDSN" | ||
|
||
public static let shared = Sentry() | ||
|
||
init() { | ||
} | ||
|
||
func setup(sendUsageData: Bool) { | ||
if isSimulator() || !sendUsageData { | ||
return | ||
} | ||
|
||
guard let dsn = Bundle.main.object(forInfoDictionaryKey: SentryDSNKey) as? String, !dsn.isEmpty else { | ||
return | ||
} | ||
|
||
do { | ||
Client.shared = try Client(dsn: dsn) | ||
try Client.shared?.startCrashHandler() | ||
|
||
// https://docs.sentry.io/clients/cocoa/advanced/#breadcrumbs | ||
Client.shared?.enableAutomaticBreadcrumbTracking() | ||
} catch let error { | ||
print("\(error)") | ||
} | ||
} | ||
|
||
private func isSimulator() -> Bool { | ||
return ProcessInfo.processInfo.environment["SIMULATOR_ROOT"] != nil | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters