Skip to content

Commit

Permalink
Merge pull request #283 from BranchMetrics/ios-warnings
Browse files Browse the repository at this point in the history
Suppress some warnings with Xcode 9
  • Loading branch information
jdee authored Oct 17, 2017
2 parents 5434a1d + 850674b commit 6c33b7c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ios/RNBranch.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 10 additions & 2 deletions ios/RNBranch.m
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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;
}
Expand Down

0 comments on commit 6c33b7c

Please sign in to comment.