此 SDK 使用 Objective-C 编写,但也可以用于 Swift 项目。 官方 Vicrab SDK for iOS/macOS/tvOS/watchOS(1)。
import Vicrab
func application(application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Create a Vicrab client and start crash handler
do {
Client.shared = try Client(dsn: "___PUBLIC_DSN___")
try Client.shared?.startCrashHandler()
} catch let error {
print("\(error)")
// Wrong DSN or KSCrash not installed
}
return true
}
(1)有限的符号支持