diff --git a/React/Modules/RCTAlertManager.h b/React/Modules/RCTAlertManager.h index b6fb21762..156531e39 100644 --- a/React/Modules/RCTAlertManager.h +++ b/React/Modules/RCTAlertManager.h @@ -10,7 +10,8 @@ #import #import "RCTBridgeModule.h" +#import "RCTInvalidating.h" -@interface RCTAlertManager : NSObject +@interface RCTAlertManager : NSObject @end diff --git a/React/Modules/RCTAlertManager.m b/React/Modules/RCTAlertManager.m index 261418b0d..b0475e231 100644 --- a/React/Modules/RCTAlertManager.m +++ b/React/Modules/RCTAlertManager.m @@ -40,6 +40,13 @@ RCT_EXPORT_MODULE() return dispatch_get_main_queue(); } +- (void)invalidate +{ + for (UIAlertView *alert in _alerts) { + [alert dismissWithClickedButtonIndex:0 animated:YES]; + } +} + /** * @param {NSDictionary} args Dictionary of the form *