Skip to content

Commit

Permalink
feat(hybrid-sdks): Add captureScreenshots to PrivateSDKOnly (#2384)
Browse files Browse the repository at this point in the history
  • Loading branch information
krystofwoldrich authored Nov 15, 2022
1 parent 435cd7f commit 72df100
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
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

0 comments on commit 72df100

Please sign in to comment.