From 7cbc0f9b9b9e715c5c6aad2a5b96ba4951c33eff Mon Sep 17 00:00:00 2001 From: messense Date: Thu, 6 Apr 2017 16:53:26 +0800 Subject: [PATCH] Add installWithBridge method --- ios/RNSentry.h | 1 + ios/RNSentry.m | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ios/RNSentry.h b/ios/RNSentry.h index d655d7d422..ee9eff310d 100644 --- a/ios/RNSentry.h +++ b/ios/RNSentry.h @@ -17,5 +17,6 @@ @interface RNSentry : NSObject + (void)installWithRootView:(RCTRootView *)rootView; ++ (void)installWithBridge:(RCTBridge *)bridge; @end diff --git a/ios/RNSentry.m b/ios/RNSentry.m index ee6c5b4422..785548f195 100644 --- a/ios/RNSentry.m +++ b/ios/RNSentry.m @@ -16,9 +16,13 @@ - (dispatch_queue_t)methodQueue return dispatch_get_main_queue(); } ++ (void)installWithBridge:(RCTBridge *)bridge { + RNSentry *sentry = [bridge moduleForName:@"RNSentry"]; + [[bridge moduleForName:@"ExceptionsManager"] initWithDelegate:sentry]; +} + + (void)installWithRootView:(RCTRootView *)rootView { - RNSentry *sentry = [rootView.bridge moduleForName:@"RNSentry"]; - [[rootView.bridge moduleForName:@"ExceptionsManager"] initWithDelegate:sentry]; + [RNSentry installWithBridge: rootView.bridge]; } + (NSNumberFormatter *)numberFormatter {