Skip to content

Instantly share code, notes, and snippets.

@ryanhoskin
Created April 22, 2022 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanhoskin/618b106b57c76dac03d2e2e0fa5e63d5 to your computer and use it in GitHub Desktop.
Save ryanhoskin/618b106b57c76dac03d2e2e0fa5e63d5 to your computer and use it in GitHub Desktop.
A basic integration to Instabug
import SwiftUI
import Instabug
@main
struct Test_6App: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
Instabug.start(withToken: "YOUR-TOKEN-HERE", invocationEvents: .floatingButton)
Instabug.reproStepsMode = .enable
//Instabug.tintColor = .red
//Instabug.setValue("TEST STRING 2", forStringWithKey: kIBGCommentFieldPlaceholderForBugReportStringName)
Instabug.show()
let error = NSError(domain: "domain", code: 500, userInfo: nil)
CrashReporting.reportError(error)
return true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment