// // AppDelegate.swift // Tusker // // Created by Shadowfacts on 8/15/18. // Copyright © 2018 Shadowfacts. All rights reserved. // import UIKit import CrashReporter import MessageUI @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { static private(set) var crashReporter: PLCrashReporter! static var pendingCrashReport: PLCrashReport? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { #if !DEBUG setupCrashReporter() #endif AppShortcutItem.createItems(for: application) return true } private func setupCrashReporter() { let config = PLCrashReporterConfig(signalHandlerType: .BSD, symbolicationStrategy: .all) AppDelegate.crashReporter = PLCrashReporter(configuration: config) if AppDelegate.crashReporter.hasPendingCrashReport() { let data = try! AppDelegate.crashReporter.loadPendingCrashReportDataAndReturnError() AppDelegate.crashReporter.purgePendingCrashReport() let report = try! PLCrashReport(data: data) AppDelegate.pendingCrashReport = report } AppDelegate.crashReporter.enable() } }