From 850674b36a429f9c58331b16ef36c47d73f82469 Mon Sep 17 00:00:00 2001 From: Jimmy Dee Date: Tue, 17 Oct 2017 09:28:04 -0700 Subject: [PATCH] Suppress some warnings with Xcode 9 --- ios/RNBranch.h | 3 +++ ios/RNBranch.m | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ios/RNBranch.h b/ios/RNBranch.h index c5955c4d4..1f683d420 100644 --- a/ios/RNBranch.h +++ b/ios/RNBranch.h @@ -17,7 +17,10 @@ extern NSString * _Nonnull const RNBranchLinkOpenedNotificationLinkPropertiesKey + (void)initSessionWithLaunchOptions:(NSDictionary * _Nullable)launchOptions isReferrable:(BOOL)isReferrable; + (BOOL)handleDeepLink:(NSURL * _Nonnull)url __deprecated_msg("Please use [RNBranch.branch application:openURL:options] or [RNBranch.branch application:openURL:sourceApplication:annotation:] instead."); +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpartial-availability" + (BOOL)continueUserActivity:(NSUserActivity * _Nonnull)userActivity; +#pragma clang diagnostic pop // Must be called before any other static method below + (void)useTestInstance; diff --git a/ios/RNBranch.m b/ios/RNBranch.m index 7a705cec7..955ef0700 100644 --- a/ios/RNBranch.m +++ b/ios/RNBranch.m @@ -159,9 +159,12 @@ + (BOOL)handleDeepLink:(NSURL *)url { return handled; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpartial-availability" + (BOOL)continueUserActivity:(NSUserActivity *)userActivity { return [self.branch continueUserActivity:userActivity]; } +#pragma clang diagnostic pop #pragma mark - Object lifecycle @@ -186,8 +189,13 @@ - (void) dealloc { - (UIViewController *)currentViewController { UIViewController *current = [UIApplication sharedApplication].keyWindow.rootViewController; - while (current.presentedViewController && ![current.presentedViewController isKindOfClass:UIAlertController.class]) { - current = current.presentedViewController; + if (@available(iOS 8.0, *)) { + while (current.presentedViewController && ![current.presentedViewController isKindOfClass:UIAlertController.class]) { + current = current.presentedViewController; + } + } else { + // RN Requires iOS 8. Nothing to do here. Still. + while (current.presentedViewController) current = current.presentedViewController; } return current; }