Skip to content

Commit

Permalink
fix ios reference
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-zimerman committed Sep 20, 2024
1 parent d03004c commit 7e5f764
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
19 changes: 5 additions & 14 deletions ios/RNSentry.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#import <dlfcn.h>
#import "RNSentry.h"
#import "RNSentryTimeToDisplay.h"

#if __has_include(<React/RCTConvert.h>)
#import <React/RCTConvert.h>
Expand Down Expand Up @@ -107,7 +108,7 @@ + (BOOL)requiresMainQueueSetup {
sentHybridSdkDidBecomeActive = true;
}

_timeToDisplay = [[RNSentryTimeToDisplayModule alloc] init];
_timeToDisplay = [[RNSentryTimeToDisplay alloc] init];

#if SENTRY_TARGET_REPLAY_SUPPORTED
[RNSentryReplay postInit];
Expand Down Expand Up @@ -779,19 +780,9 @@ - (NSDictionary*) fetchNativeStackFramesBy: (NSArray<NSNumber*>*)instructionsAdd
}
#endif

// Expose timeToDisplay to JS as an object with properties
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(getTimeToDisplay) {
NSMutableDictionary *timeToDisplayDict = [NSMutableDictionary new];

// Expose the methods as key-value pairs
timeToDisplayDict[@"requestAnimationFrame"] = @([_timeToDisplay requestAnimationFrame]);
timeToDisplayDict[@"isAvailable"] = @([_timeToDisplay isAvailable]);

return timeToDisplayDict;
}

RCT_EXPORT_METHOD(getTimeToDisplay:(RCTResponseSenderBlock)callback) {
[_timeToDisplay getNewScreenTimeToDisplay:callback];
RCT_EXPORT_METHOD(getNewScreenTimeToDisplay:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject) {
[_timeToDisplay getTimeToDisplay:resolve];
}


Expand Down
2 changes: 1 addition & 1 deletion ios/RNSentryTimeToDisplay.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import <React/RCTBridgeModule.h>

@interface RNSentryTimeToDisplayModule : NSObject
@interface RNSentryTimeToDisplay : NSObject

- (void)getTimeToDisplay:(RCTResponseSenderBlock)callback;

Expand Down

0 comments on commit 7e5f764

Please sign in to comment.