diff --git a/Samples/iOS-ObjectiveC/iOS-ObjectiveC/ViewController.m b/Samples/iOS-ObjectiveC/iOS-ObjectiveC/ViewController.m index c6632756f6..c048ac9b91 100644 --- a/Samples/iOS-ObjectiveC/iOS-ObjectiveC/ViewController.m +++ b/Samples/iOS-ObjectiveC/iOS-ObjectiveC/ViewController.m @@ -71,14 +71,11 @@ - (IBAction)captureUserFeedback:(id)sender captureError:error withScopeBlock:^(SentryScope *_Nonnull scope) { [scope setLevel:kSentryLevelFatal]; }]; - SentryFeedback *feedback = [[SentryFeedback alloc] - initWithMessage:@"It broke on iOS-ObjectiveC. I don't know why, but this happens." - name:@"John Me" - email:@"john@me.com" - source:SentryFeedbackSourceCustom - associatedEventId:nil - screenshot:nil]; - [SentrySDK captureUserFeedback:feedback]; + SentryUserFeedback *userFeedback = [[SentryUserFeedback alloc] initWithEventId:eventId]; + userFeedback.comments = @"It broke on iOS-ObjectiveC. I don't know why, but this happens."; + userFeedback.email = @"john@me.com"; + userFeedback.name = @"John Me"; + [SentrySDK captureUserFeedback:userFeedback]; } - (IBAction)captureError:(id)sender diff --git a/Samples/iOS-Swift/iOS-Swift/ExtraViewController.swift b/Samples/iOS-Swift/iOS-Swift/ExtraViewController.swift index abd62874ca..b222ff56ea 100644 --- a/Samples/iOS-Swift/iOS-Swift/ExtraViewController.swift +++ b/Samples/iOS-Swift/iOS-Swift/ExtraViewController.swift @@ -143,8 +143,17 @@ class ExtraViewController: UIViewController { @IBAction func captureUserFeedback(_ sender: UIButton) { highlightButton(sender) - let feedback = SentryFeedback(message: "It broke on iOS-Swift. I don't know why, but this happens.", name: "John Me", email: "john@me.com", source: .custom, associatedEventId: nil, screenshot: nil) - SentrySDK.capture(userFeedback: feedback) + let error = NSError(domain: "UserFeedbackErrorDomain", code: 0, userInfo: [NSLocalizedDescriptionKey: "This never happens."]) + + let eventId = SentrySDK.capture(error: error) { scope in + scope.setLevel(.fatal) + } + + let userFeedback = UserFeedback(eventId: eventId) + userFeedback.comments = "It broke on iOS-Swift. I don't know why, but this happens." + userFeedback.email = "john@me.com" + userFeedback.name = "John Me" + SentrySDK.capture(userFeedback: userFeedback) } @IBAction func permissions(_ sender: UIButton) { diff --git a/Sources/Sentry/Public/SentrySDK.h b/Sources/Sentry/Public/SentrySDK.h index 3f53c721eb..b93a824334 100644 --- a/Sources/Sentry/Public/SentrySDK.h +++ b/Sources/Sentry/Public/SentrySDK.h @@ -254,7 +254,8 @@ SENTRY_NO_INIT * Captures user feedback that was manually gathered and sends it to Sentry. * @param userFeedback The user feedback to send to Sentry. */ -+ (void)captureUserFeedback:(SentryFeedback *)userFeedback NS_SWIFT_NAME(capture(userFeedback:)); ++ (void)captureUserFeedback:(SentryUserFeedback *)userFeedback + NS_SWIFT_NAME(capture(userFeedback:)); /** * Adds a Breadcrumb to the current Scope of the current Hub. If the total number of breadcrumbs