diff --git a/ios/RCTContactsWrapper/RCTContactsWrapper.m b/ios/RCTContactsWrapper/RCTContactsWrapper.m index 72243ca..10906aa 100644 --- a/ios/RCTContactsWrapper/RCTContactsWrapper.m +++ b/ios/RCTContactsWrapper/RCTContactsWrapper.m @@ -67,14 +67,10 @@ -(void) launchContacts { } //Launch Contact Picker or Address Book View Controller UIViewController *root = [[[UIApplication sharedApplication] delegate] window].rootViewController; - BOOL modalPresent = (BOOL) (root.presentedViewController); - if (modalPresent) { - UIViewController *parent = root.presentedViewController; - [parent presentViewController:picker animated:YES completion:nil]; - } else { - [root presentViewController:picker animated:YES completion:nil]; + while (root.presentedViewController) { + root = root.presentedViewController; } - + [root presentViewController:picker animated:YES completion:nil]; }