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

feat(feedback): initial release #4874

Merged
merged 28 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
165e716
WIP: last minute tweaks to apis to align implementation and docs
armcknight Feb 19, 2025
ec5c3cd
WIP: we need to make these changes in the public release pr
armcknight Feb 20, 2025
601febe
change the init parameter to be more generic for future expansion pos…
armcknight Feb 20, 2025
c0c3421
Format code
getsentry-bot Feb 20, 2025
b4f5b1b
use SentryId instead of String
armcknight Feb 20, 2025
2ef90a3
followups
armcknight Feb 20, 2025
05f6fb5
WIP: expose necessary interfaces publicly
armcknight Feb 19, 2025
c808ffa
changelog
armcknight Feb 19, 2025
8a44552
add screenshot to attach via the manual call to submit feedback
armcknight Feb 20, 2025
452f30f
Revert "WIP: we need to make these changes in the public release pr"
armcknight Feb 20, 2025
5957494
use the new api
armcknight Feb 20, 2025
35176f9
Format code
getsentry-bot Feb 20, 2025
aaa25cf
fix test failure and add some missing ones
armcknight Feb 20, 2025
4d9e0bf
actually these will need to be accessible from other sdk code and tests
armcknight Feb 20, 2025
e1e8f9e
add button to objc sample app to send new feedback in addition to the…
armcknight Feb 20, 2025
fd60904
also do it for iOS-Swift and differentiate the feedback
armcknight Feb 20, 2025
7e13131
add new docs link to headerdoc
armcknight Feb 20, 2025
00b833a
deprecate old methods and types
armcknight Feb 20, 2025
ace8109
more exposures and deprecations
armcknight Feb 20, 2025
bd9301e
deprecation workarounds in swift test code
armcknight Feb 20, 2025
a31eac6
fix broken preexisting test
armcknight Feb 20, 2025
623391d
fixing new replacement test cases, plus a todo to fix the last one
armcknight Feb 20, 2025
105cde7
Format code
getsentry-bot Feb 20, 2025
b0a9f3f
improve deprecation message and remove todo
armcknight Feb 20, 2025
5024f37
found a way to validate feedback events are sent
armcknight Feb 20, 2025
40bc8fa
Merge remote-tracking branch 'origin/main' into armcknight/feat(feedb…
armcknight Feb 24, 2025
ae42d84
pr feedback
armcknight Feb 25, 2025
5307575
more feedback and fix a bad merge
armcknight Feb 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Features

- New user feedback API and Widget (#4874)

### Improvements

- Log message when setting user before starting the SDK (#4882)
Expand Down
Binary file added Samples/Shared/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions Samples/iOS-ObjectiveC/iOS-ObjectiveC.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
7B3427FB25876DDC00056519 /* Tongariro.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 7B3427F925876DDB00056519 /* Tongariro.jpg */; };
7B64387A26A6C69F000D0F65 /* LaunchUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B64387926A6C69F000D0F65 /* LaunchUITests.swift */; };
7B8A5C9E2715B5DE008ACD3B /* InitializerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B8A5C9D2715B5DE008ACD3B /* InitializerViewController.m */; };
849C4A6B2D66D05600FA632D /* screenshot.png in Resources */ = {isa = PBXBuildFile; fileRef = 849C4A6A2D66D05600FA632D /* screenshot.png */; };
84BA72AB2C9369A40045B828 /* GitInjections.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84BA72A92C9369A40045B828 /* GitInjections.swift */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -51,6 +52,13 @@
remoteGlobalIDString = 637AFDC5243B036B0034958B;
remoteInfo = "iOS-ObjectiveC";
};
849C4A722D66D05600FA632D /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 630853352440C45500DDE4CE /* Sentry.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = D833D7342D1321C100961E7A;
remoteInfo = SentrySwiftUITests;
};
84BA72732C9367A10045B828 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 630853352440C45500DDE4CE /* Sentry.xcodeproj */;
Expand Down Expand Up @@ -116,6 +124,7 @@
7B64387B26A6C69F000D0F65 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
7B8A5C9C2715B5CF008ACD3B /* InitializerViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InitializerViewController.h; sourceTree = "<group>"; };
7B8A5C9D2715B5DE008ACD3B /* InitializerViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = InitializerViewController.m; sourceTree = "<group>"; };
849C4A6A2D66D05600FA632D /* screenshot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = screenshot.png; sourceTree = "<group>"; };
84BA72A92C9369A40045B828 /* GitInjections.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GitInjections.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -147,6 +156,7 @@
84BA72762C9367A10045B828 /* SentryProfilerTests.xctest */,
84BA72782C9367A10045B828 /* libSentryTestUtils.a */,
84BA727A2C9367A10045B828 /* SentryTestUtilsDynamic.framework */,
849C4A732D66D05600FA632D /* SentrySwiftUITests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -213,6 +223,7 @@
84BA72AA2C9369A40045B828 /* Shared */ = {
isa = PBXGroup;
children = (
849C4A6A2D66D05600FA632D /* screenshot.png */,
84BA72A92C9369A40045B828 /* GitInjections.swift */,
);
name = Shared;
Expand Down Expand Up @@ -320,6 +331,13 @@
remoteRef = 6308533C2440C45500DDE4CE /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
849C4A732D66D05600FA632D /* SentrySwiftUITests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = SentrySwiftUITests.xctest;
remoteRef = 849C4A722D66D05600FA632D /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
84BA72742C9367A10045B828 /* SentrySwiftUI.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
Expand Down Expand Up @@ -359,6 +377,7 @@
637AFDD9243B036D0034958B /* LaunchScreen.storyboard in Resources */,
7B3427FB25876DDC00056519 /* Tongariro.jpg in Resources */,
637AFDD4243B036B0034958B /* Main.storyboard in Resources */,
849C4A6B2D66D05600FA632D /* screenshot.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
27 changes: 16 additions & 11 deletions Samples/iOS-ObjectiveC/iOS-ObjectiveC/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand All @@ -24,7 +23,7 @@
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="AVC-4r-eVc">
<rect key="frame" x="8" y="120.5" width="398" height="270"/>
<rect key="frame" x="8" y="120.5" width="398" height="300"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rUC-at-hwU">
<rect key="frame" x="0.0" y="0.0" width="398" height="30"/>
Expand All @@ -45,47 +44,53 @@
<rect key="frame" x="0.0" y="60" width="398" height="30"/>
<state key="normal" title="captureUserFeedback"/>
<connections>
<action selector="captureMessage:" destination="BYZ-38-t0r" eventType="touchUpInside" id="dxD-CU-dxJ"/>
<action selector="captureUserFeedback:" destination="BYZ-38-t0r" eventType="touchUpInside" id="PfT-MW-tlq"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="G9Q-jA-9Nd">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="GFX-14-5JR">
<rect key="frame" x="0.0" y="90" width="398" height="30"/>
<state key="normal" title="captureUserFeedbackV2"/>
<connections>
<action selector="captureUserFeedbackV2:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Teu-9p-m5v"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="G9Q-jA-9Nd">
<rect key="frame" x="0.0" y="120" width="398" height="30"/>
<state key="normal" title="captureNSError"/>
<connections>
<action selector="captureError:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Btq-8D-8N6"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ugR-6E-UFA">
<rect key="frame" x="0.0" y="120" width="398" height="30"/>
<rect key="frame" x="0.0" y="150" width="398" height="30"/>
<state key="normal" title="captureNSException"/>
<connections>
<action selector="captureException:" destination="BYZ-38-t0r" eventType="touchUpInside" id="ezD-qB-SSr"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="I9B-iL-of0">
<rect key="frame" x="0.0" y="150" width="398" height="30"/>
<rect key="frame" x="0.0" y="180" width="398" height="30"/>
<state key="normal" title="captureTransaction"/>
<connections>
<action selector="captureTransaction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="uaN-VO-vJA"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="PFR-up-CPy">
<rect key="frame" x="0.0" y="180" width="398" height="30"/>
<rect key="frame" x="0.0" y="210" width="398" height="30"/>
<state key="normal" title="crash"/>
<connections>
<action selector="crash:" destination="BYZ-38-t0r" eventType="touchUpInside" id="6xT-zA-EZI"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eUX-Yi-7fo">
<rect key="frame" x="0.0" y="210" width="398" height="30"/>
<rect key="frame" x="0.0" y="240" width="398" height="30"/>
<state key="normal" title="sigsevCrash"/>
<connections>
<action selector="sigsevCrash:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Z0n-Rw-Tpu"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7cg-k4-wJ5" userLabel="oomCrash">
<rect key="frame" x="0.0" y="240" width="398" height="30"/>
<rect key="frame" x="0.0" y="270" width="398" height="30"/>
<state key="normal" title="OOM Crash"/>
<connections>
<action selector="oomCrash:" destination="BYZ-38-t0r" eventType="touchUpInside" id="6Eb-uS-ljp"/>
Expand Down
22 changes: 22 additions & 0 deletions Samples/iOS-ObjectiveC/iOS-ObjectiveC/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,28 @@ - (IBAction)captureUserFeedback:(id)sender
[SentrySDK captureUserFeedback:userFeedback];
}

- (IBAction)captureUserFeedbackV2:(id)sender
{
NSData *data = [NSData dataWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"screenshot"
withExtension:@"png"]];
NSArray<NSData *> *attachments = nil;
if (data != nil) {
attachments = @[ data ];
}
SentryId *errorEventID =
[SentrySDK captureError:[NSError errorWithDomain:@"test-error.user-feedback.iOS-ObjectiveC"
code:1
userInfo:nil]];
SentryFeedback *feedback = [[SentryFeedback alloc]
initWithMessage:@"It broke again on iOS-ObjectiveC. I don't know why, but this happens."
name:@"John Me"
email:@"[email protected]"
source:SentryFeedbackSourceCustom
associatedEventId:errorEventID
attachments:attachments];
[SentrySDK captureFeedback:feedback];
}

- (IBAction)captureError:(id)sender
{
NSError *error =
Expand Down
4 changes: 4 additions & 0 deletions Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
844DA822282584F700E6B62E /* SentryData.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = D845F35927BAD4CC00A4D7A2 /* SentryData.xcdatamodeld */; };
847670302BAA4AFA001A4E31 /* NSObject+SentryAppSetup.m in Sources */ = {isa = PBXBuildFile; fileRef = 8476702F2BAA4AFA001A4E31 /* NSObject+SentryAppSetup.m */; };
848A256D286E3351008A8858 /* fatal-error-binary-images-message2.json in Resources */ = {isa = PBXBuildFile; fileRef = D83A30DF279F1F5C00372D0A /* fatal-error-binary-images-message2.json */; };
849C4A692D66CA1600FA632D /* screenshot.png in Resources */ = {isa = PBXBuildFile; fileRef = 849C4A682D66CA1600FA632D /* screenshot.png */; };
84A5D72629D2705000388BFA /* ProfilingUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A5D72529D2705000388BFA /* ProfilingUITests.swift */; };
84A5D72D29D2708D00388BFA /* UITestHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A5D72C29D2708D00388BFA /* UITestHelpers.swift */; };
84AB90712A5001000054C99A /* ProfilingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84AB90702A5001000054C99A /* ProfilingViewController.swift */; };
Expand Down Expand Up @@ -277,6 +278,7 @@
8476702F2BAA4AFA001A4E31 /* NSObject+SentryAppSetup.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSObject+SentryAppSetup.m"; sourceTree = "<group>"; };
848A2573286E3351008A8858 /* PerformanceBenchmarks.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PerformanceBenchmarks.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
848A2578286E3490008A8858 /* PerformanceBenchmarks-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "PerformanceBenchmarks-Info.plist"; sourceTree = "<group>"; };
849C4A682D66CA1600FA632D /* screenshot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = screenshot.png; sourceTree = "<group>"; };
84A5D72529D2705000388BFA /* ProfilingUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfilingUITests.swift; sourceTree = "<group>"; };
84A5D72C29D2708D00388BFA /* UITestHelpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITestHelpers.swift; sourceTree = "<group>"; };
84AB90702A5001000054C99A /* ProfilingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfilingViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -548,6 +550,7 @@
isa = PBXGroup;
children = (
84BA72A52C93698E0045B828 /* GitInjections.swift */,
849C4A682D66CA1600FA632D /* screenshot.png */,
);
name = Shared;
path = ../Shared;
Expand Down Expand Up @@ -918,6 +921,7 @@
7B3427F825876A5200056519 /* Tongariro.jpg in Resources */,
637AFDB1243B02760034958B /* Main.storyboard in Resources */,
D8C484852CCF902F00503B14 /* SampleAssets.xcassets in Resources */,
849C4A692D66CA1600FA632D /* screenshot.png in Resources */,
D8FD68C42C1C86E300A70055 /* TableViewController.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Loading
Loading