Skip to content

Commit 9f245ac

Browse files
author
Adam Rush
committed
Adding Sentry tracking to the demo app
1 parent 3a29ad6 commit 9f245ac

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

DemoAppSwiftUI/AppDelegate.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import StreamChat
66
import StreamChatSwiftUI
77
import SwiftUI
88
import UIKit
9+
import Sentry
910

1011
class AppDelegate: NSObject, UIApplicationDelegate {
1112

@@ -53,6 +54,14 @@ class AppDelegate: NSObject, UIApplicationDelegate {
5354
streamChat = StreamChat(chatClient: chatClient, utils: utils)
5455
*/
5556

57+
#if RELEASE
58+
// We're tracking Crash Reports / Issues from the Demo App to keep improving the SDK
59+
SentrySDK.start { options in
60+
options.dsn = "https://[email protected]/6395489"
61+
options.tracesSampleRate = 1.0
62+
}
63+
#endif
64+
5665
streamChat = StreamChat(chatClient: chatClient)
5766

5867
DispatchQueue.main.asyncAfter(deadline: .now() + 2.5) {

StreamChatSwiftUI.xcodeproj/project.pbxproj

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@
327327
84F2908E276B92A40045472D /* GalleryHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F2908D276B92A40045472D /* GalleryHeaderView.swift */; };
328328
84F29090276CC1280045472D /* ShareButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F2908F276CC1280045472D /* ShareButtonView.swift */; };
329329
84FF723F2782FB2E006E26C8 /* iMessagePocView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84FF723E2782FB2E006E26C8 /* iMessagePocView.swift */; };
330+
E3A1C01C282BAC66002D1E26 /* Sentry in Frameworks */ = {isa = PBXBuildFile; productRef = E3A1C01B282BAC66002D1E26 /* Sentry */; };
330331
/* End PBXBuildFile section */
331332

332333
/* Begin PBXContainerItemProxy section */
@@ -717,6 +718,7 @@
717718
buildActionMask = 2147483647;
718719
files = (
719720
8465FCE6274695B400AF091E /* StreamChatSwiftUI.framework in Frameworks */,
721+
E3A1C01C282BAC66002D1E26 /* Sentry in Frameworks */,
720722
);
721723
runOnlyForDeploymentPostprocessing = 0;
722724
};
@@ -1465,6 +1467,9 @@
14651467
8465FCE9274695B400AF091E /* PBXTargetDependency */,
14661468
);
14671469
name = DemoAppSwiftUI;
1470+
packageProductDependencies = (
1471+
E3A1C01B282BAC66002D1E26 /* Sentry */,
1472+
);
14681473
productName = DemoAppSwiftUI;
14691474
productReference = 8465FCBC27468B6900AF091E /* DemoAppSwiftUI.app */;
14701475
productType = "com.apple.product-type.application";
@@ -1505,6 +1510,7 @@
15051510
8465FCB527468B0600AF091E /* XCRemoteSwiftPackageReference "NukeUI" */,
15061511
848399E6275FB3BE003075E4 /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */,
15071512
847CEFEA27BFAB6400606257 /* XCRemoteSwiftPackageReference "stream-chat-swift" */,
1513+
E3A1C01A282BAC66002D1E26 /* XCRemoteSwiftPackageReference "sentry-cocoa" */,
15081514
);
15091515
productRefGroup = 8465FBB62746873A00AF091E /* Products */;
15101516
projectDirPath = "";
@@ -2225,6 +2231,7 @@
22252231
DEVELOPMENT_ASSET_PATHS = "\"DemoAppSwiftUI/Preview Content\"";
22262232
DEVELOPMENT_TEAM = EHV7XZLAHA;
22272233
ENABLE_PREVIEWS = YES;
2234+
GCC_PREPROCESSOR_DEFINITIONS = "RELEASE=1";
22282235
GENERATE_INFOPLIST_FILE = NO;
22292236
INFOPLIST_FILE = DemoAppSwiftUI/Info.plist;
22302237
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
@@ -2320,6 +2327,14 @@
23202327
minimumVersion = 1.8.2;
23212328
};
23222329
};
2330+
E3A1C01A282BAC66002D1E26 /* XCRemoteSwiftPackageReference "sentry-cocoa" */ = {
2331+
isa = XCRemoteSwiftPackageReference;
2332+
repositoryURL = "https://github.com/getsentry/sentry-cocoa.git";
2333+
requirement = {
2334+
kind = upToNextMajorVersion;
2335+
minimumVersion = 7.0.0;
2336+
};
2337+
};
23232338
/* End XCRemoteSwiftPackageReference section */
23242339

23252340
/* Begin XCSwiftPackageProductDependency section */
@@ -2343,6 +2358,11 @@
23432358
package = 848399E6275FB3BE003075E4 /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */;
23442359
productName = SnapshotTesting;
23452360
};
2361+
E3A1C01B282BAC66002D1E26 /* Sentry */ = {
2362+
isa = XCSwiftPackageProductDependency;
2363+
package = E3A1C01A282BAC66002D1E26 /* XCRemoteSwiftPackageReference "sentry-cocoa" */;
2364+
productName = Sentry;
2365+
};
23462366
/* End XCSwiftPackageProductDependency section */
23472367

23482368
/* Begin XCVersionGroup section */

0 commit comments

Comments
 (0)