Skip to content

Commit

Permalink
WIP: we need to make these changes in the public release pr
Browse files Browse the repository at this point in the history
  • Loading branch information
armcknight committed Feb 20, 2025
1 parent 165e716 commit ec5c3cd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
13 changes: 5 additions & 8 deletions Samples/iOS-ObjectiveC/iOS-ObjectiveC/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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:@"[email protected]"
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 = @"[email protected]";
userFeedback.name = @"John Me";
[SentrySDK captureUserFeedback:userFeedback];
}

- (IBAction)captureError:(id)sender
Expand Down
13 changes: 11 additions & 2 deletions Samples/iOS-Swift/iOS-Swift/ExtraViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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: "[email protected]", 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 = "[email protected]"
userFeedback.name = "John Me"
SentrySDK.capture(userFeedback: userFeedback)
}

@IBAction func permissions(_ sender: UIButton) {
Expand Down
3 changes: 2 additions & 1 deletion Sources/Sentry/Public/SentrySDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ec5c3cd

Please sign in to comment.