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(hybrid-sdks): Add captureScreenshots to PrivateSDKOnly #2384

Merged
merged 4 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions Sources/Sentry/PrivateSentrySDKOnly.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#import "SentrySerialization.h"
#import <SentryDependencyContainer.h>
#import <SentryFramesTracker.h>
#import <SentryScreenshot.h>

@implementation PrivateSentrySDKOnly

Expand Down Expand Up @@ -120,6 +121,11 @@ + (SentryScreenFrames *)currentScreenFrames
return [SentryFramesTracker sharedInstance].currentFrames;
}

+ (NSArray<NSData *> *)captureScreenshots
{
return [SentryDependencyContainer.sharedInstance.screenshot takeScreenshots];
}

#endif

@end
2 changes: 2 additions & 0 deletions Sources/Sentry/include/PrivateSentrySDKOnly.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ typedef void (^SentryOnAppStartMeasurementAvailable)(
@property (class, nonatomic, assign, readonly) BOOL isFramesTrackingRunning;

@property (class, nonatomic, assign, readonly) SentryScreenFrames *currentScreenFrames;

+ (NSArray<NSData *> *)captureScreenshots;
#endif

@end
Expand Down
2 changes: 2 additions & 0 deletions Sources/Sentry/include/SentryScreenshot.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ NS_ASSUME_NONNULL_BEGIN
- (nullable NSArray<NSData *> *)appScreenshots;

- (void)saveScreenShots:(NSString *)path;

- (NSArray<NSData *> *)takeScreenshots;
@end

NS_ASSUME_NONNULL_END
Expand Down