Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ios] impl crash report feature #45

Merged
merged 6 commits into from
Jun 18, 2024
Merged

[ios] impl crash report feature #45

merged 6 commits into from
Jun 18, 2024

Conversation

RyosukeCla
Copy link
Collaborator

import SwiftUI
import Nativebrik
import UIKit

let nativebrik = NativebrikClient(projectId: "XXXX")

class AppDelegate: NSObject, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        NSSetUncaughtExceptionHandler { exception in
            nativebrik.experiment.record(exception: exception)
        }
        return true
    }
}

@main
struct ExampleApp: App {
    @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
    
    var body: some Scene {
        WindowGroup {
            NativebrikProvider(
                client: nativebrik
            ) {
                ContentView()
            }
        }
    }
}

feat: Add crash reporting functionality to TrackRepository2

This commit adds the necessary code to implement crash reporting functionality in the `TrackRepository2` protocol and its implementation `TrackRespositoryImpl`. It introduces a new `record` method that takes an `NSException` parameter and records the crash details in a `CrashRecord` struct. The `report` method is also added to check for any pending crash records and send them along with other events in the buffer.
feat: Add record method to Container protocol for crash reporting

This commit adds a new method, `record`, to the `Container` protocol in the `cotnainer.swift` file. The `record` method takes an `NSException` parameter and is responsible for recording crash details. This change enables crash reporting functionality in the app.
@RyosukeCla RyosukeCla changed the title [ios] impl crash record [ios] impl crash record feature Jun 18, 2024
@RyosukeCla RyosukeCla changed the title [ios] impl crash record feature [ios] impl crash report feature Jun 18, 2024
@RyosukeCla RyosukeCla merged commit eea2815 into main Jun 18, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant