Skip to content

Commit ce10f3b

Browse files
authored
Merge pull request #30 from messense/installWithBridge
Add installWithBridge method
2 parents f936336 + 7cbc0f9 commit ce10f3b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

ios/RNSentry.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
@interface RNSentry : NSObject <RCTBridgeModule, RCTExceptionsManagerDelegate>
1818

1919
+ (void)installWithRootView:(RCTRootView *)rootView;
20+
+ (void)installWithBridge:(RCTBridge *)bridge;
2021

2122
@end

ios/RNSentry.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ - (dispatch_queue_t)methodQueue
1616
return dispatch_get_main_queue();
1717
}
1818

19+
+ (void)installWithBridge:(RCTBridge *)bridge {
20+
RNSentry *sentry = [bridge moduleForName:@"RNSentry"];
21+
[[bridge moduleForName:@"ExceptionsManager"] initWithDelegate:sentry];
22+
}
23+
1924
+ (void)installWithRootView:(RCTRootView *)rootView {
20-
RNSentry *sentry = [rootView.bridge moduleForName:@"RNSentry"];
21-
[[rootView.bridge moduleForName:@"ExceptionsManager"] initWithDelegate:sentry];
25+
[RNSentry installWithBridge: rootView.bridge];
2226
}
2327

2428
+ (NSNumberFormatter *)numberFormatter {

0 commit comments

Comments
 (0)