diff --git a/ios/RNExitApp/RNExitApp.mm b/ios/RNExitApp/RNExitApp.mm index 4c9bcd4..5156ce4 100644 --- a/ios/RNExitApp/RNExitApp.mm +++ b/ios/RNExitApp/RNExitApp.mm @@ -12,7 +12,13 @@ @implementation RNExitApp RCT_EXPORT_METHOD(exitApp) { - exit(0); + dispatch_async(dispatch_get_main_queue(), ^{ + [[UIApplication sharedApplication] performSelector:@selector(suspend)]; + + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + exit(0); + }); + }); }; # pragma mark - New Architecture