diff --git a/iphone/Classes/GeolocationModule.m b/iphone/Classes/GeolocationModule.m index 5960b3751bc..49153b2e106 100644 --- a/iphone/Classes/GeolocationModule.m +++ b/iphone/Classes/GeolocationModule.m @@ -317,11 +317,10 @@ - (CLLocationManager *)locationManager locationManager.allowsBackgroundLocationUpdates = allowsBackgroundLocationUpdates; -#if IS_SDK_IOS_11 if ([TiUtils isIOSVersionOrGreater:@"11.0"]) { locationManager.showsBackgroundLocationIndicator = showBackgroundLocationIndicator; } -#endif + locationManager.activityType = activityType; locationManager.pausesLocationUpdatesAutomatically = pauseLocationUpdateAutomatically; @@ -605,23 +604,19 @@ - (void)setHeadingFilter:(CLLocationDegrees)value - (BOOL)showBackgroundLocationIndicator { -#if IS_SDK_IOS_11 if ([TiUtils isIOSVersionOrGreater:@"11.0"]) { return showBackgroundLocationIndicator; } -#endif DebugLog(@"[ERROR] The showBackgroundLocationIndicator property is only available on iOS 11.0+. Returning \"false\" ..."); return NO; } - (void)setShowBackgroundLocationIndicator:(BOOL)value { -#if IS_SDK_IOS_11 if ([TiUtils isIOSVersionOrGreater:@"11.0"]) { showBackgroundLocationIndicator = value; return; } -#endif DebugLog(@"[ERROR] The showBackgroundLocationIndicator property is only available on iOS 11.0+. Ignoring call ..."); } diff --git a/iphone/Classes/TiAppiOSUserNotificationCenterProxy.m b/iphone/Classes/TiAppiOSUserNotificationCenterProxy.m index a64399b3daf..656a98b5a17 100644 --- a/iphone/Classes/TiAppiOSUserNotificationCenterProxy.m +++ b/iphone/Classes/TiAppiOSUserNotificationCenterProxy.m @@ -109,23 +109,24 @@ - (void)removePendingNotifications:(id)args } }]; } else { - TiThreadPerformOnMainThread(^{ - if (args == nil || [args count] == 0) { - [[UIApplication sharedApplication] cancelAllLocalNotifications]; - return; - } + TiThreadPerformOnMainThread( + ^{ + if (args == nil || [args count] == 0) { + [[UIApplication sharedApplication] cancelAllLocalNotifications]; + return; + } - for (UILocalNotification *scheduledNotification in UIApplication.sharedApplication.scheduledLocalNotifications) { - for (id notification in args) { - ENSURE_TYPE(notification, NSDictionary); + for (UILocalNotification *scheduledNotification in UIApplication.sharedApplication.scheduledLocalNotifications) { + for (id notification in args) { + ENSURE_TYPE(notification, NSDictionary); - if ([notification[@"userInfo"][@"id"] isEqual:scheduledNotification.userInfo[@"id"]]) { - [UIApplication.sharedApplication cancelLocalNotification:scheduledNotification]; - break; + if ([notification[@"userInfo"][@"id"] isEqual:scheduledNotification.userInfo[@"id"]]) { + [UIApplication.sharedApplication cancelLocalNotification:scheduledNotification]; + break; + } + } } - } - } - }, + }, NO); } } @@ -178,11 +179,11 @@ - (void)requestUserNotificationSettings:(id)callback @"carPlaySetting" : @([settings carPlaySetting]), @"alertStyle" : @([settings alertStyle]) } mutableCopy]; -#if IS_SDK_IOS_11 + if ([TiUtils isIOSVersionOrGreater:@"11.0"]) { propertiesDict[@"showPreviewsSetting"] = @([settings showPreviewsSetting]); } -#endif + #if IS_SDK_IOS_12 if ([TiUtils isIOSVersionOrGreater:@"12.0"]) { propertiesDict[@"criticalAlertSetting"] = @([settings criticalAlertSetting]); diff --git a/iphone/Classes/TiUIListView.m b/iphone/Classes/TiUIListView.m index afaeb9db9c6..30698949314 100644 --- a/iphone/Classes/TiUIListView.m +++ b/iphone/Classes/TiUIListView.m @@ -2238,7 +2238,6 @@ - (void)viewResignFocus - (void)viewGetFocus { -#if IS_SDK_IOS_11 if (isSearchBarInNavigation) { id proxy = [(TiViewProxy *)self.proxy parent]; while ([proxy isKindOfClass:[TiViewProxy class]] && ![proxy isKindOfClass:[TiWindowProxy class]]) { @@ -2254,7 +2253,6 @@ - (void)viewGetFocus controller.navigationItem.searchController = searchController; } } -#endif if (isSearched && self.searchedString && ![searchController isActive]) { isSearched = NO; diff --git a/iphone/Classes/TiUINavigationWindowProxy.m b/iphone/Classes/TiUINavigationWindowProxy.m index f1004fa14d7..5b2dcb19126 100644 --- a/iphone/Classes/TiUINavigationWindowProxy.m +++ b/iphone/Classes/TiUINavigationWindowProxy.m @@ -213,9 +213,7 @@ - (void)navigationController:(UINavigationController *)navigationController will } } TiWindowProxy *theWindow = (TiWindowProxy *)[(TiViewController *)viewController proxy]; -#if IS_SDK_IOS_11 [theWindow processForSafeArea]; -#endif if ((theWindow != rootWindow) && [theWindow opening]) { [theWindow windowWillOpen]; [theWindow windowDidOpen]; @@ -389,7 +387,6 @@ - (void)viewDidDisappear:(BOOL)animated [super viewDidDisappear:animated]; } -#if IS_SDK_IOS_11 - (BOOL)homeIndicatorAutoHide { UIViewController *topVC = [navController topViewController]; @@ -401,7 +398,6 @@ - (BOOL)homeIndicatorAutoHide } return [super homeIndicatorAutoHide]; } -#endif - (BOOL)hidesStatusBar { diff --git a/iphone/Classes/TiUIScrollView.m b/iphone/Classes/TiUIScrollView.m index 597221428d3..b6fd5511c83 100644 --- a/iphone/Classes/TiUIScrollView.m +++ b/iphone/Classes/TiUIScrollView.m @@ -147,7 +147,6 @@ - (TiUIScrollViewImpl *)scrollView - (void)adjustScrollViewInsets { -#if IS_SDK_IOS_11 id viewProxy = self.proxy; while (viewProxy && ![viewProxy isKindOfClass:[TiWindowProxy class]]) { viewProxy = [viewProxy parent]; @@ -160,7 +159,6 @@ - (void)adjustScrollViewInsets [scrollView setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever]; } } -#endif } - (id)accessibilityElement diff --git a/iphone/Classes/TiUITabGroupProxy.m b/iphone/Classes/TiUITabGroupProxy.m index 2d85262577f..3f6f3e379aa 100644 --- a/iphone/Classes/TiUITabGroupProxy.m +++ b/iphone/Classes/TiUITabGroupProxy.m @@ -267,7 +267,6 @@ - (UIStatusBarStyle)preferredStatusBarStyle; return [super preferredStatusBarStyle]; } -#if IS_SDK_IOS_11 - (BOOL)homeIndicatorAutoHide { UITabBarController *tabController = [(TiUITabGroup *)[self view] tabController]; @@ -277,7 +276,6 @@ - (BOOL)homeIndicatorAutoHide } return [super homeIndicatorAutoHide]; } -#endif - (BOOL)hidesStatusBar { diff --git a/iphone/Classes/TiUITabProxy.m b/iphone/Classes/TiUITabProxy.m index 05c31d10929..95fed1a1042 100644 --- a/iphone/Classes/TiUITabProxy.m +++ b/iphone/Classes/TiUITabProxy.m @@ -269,9 +269,8 @@ - (void)openWindow:(NSArray *)args TiWindowProxy *window = [args objectAtIndex:0]; ENSURE_TYPE(window, TiWindowProxy); -#if IS_SDK_IOS_11 [window processForSafeArea]; -#endif + if (window == rootWindow) { [rootWindow windowWillOpen]; [rootWindow windowDidOpen]; @@ -404,9 +403,8 @@ - (void)handleWillShowViewController:(UIViewController *)viewController animated } } TiWindowProxy *theWindow = (TiWindowProxy *)[(TiViewController *)viewController proxy]; -#if IS_SDK_IOS_11 [theWindow processForSafeArea]; -#endif + if (theWindow == rootWindow) { //This is probably too late for the root view controller. //Figure out how to call open before this callback @@ -766,7 +764,6 @@ - (void)popToRootWindow:(id)args @synthesize parentOrientationController; -#if IS_SDK_IOS_11 - (BOOL)homeIndicatorAutoHide { if (rootWindow == nil) { @@ -783,7 +780,7 @@ - (BOOL)homeIndicatorAutoHide } return NO; } -#endif + - (BOOL)hidesStatusBar { if (rootWindow == nil) { diff --git a/iphone/Classes/TiUITableView.m b/iphone/Classes/TiUITableView.m index 8141c55405a..dc12e774f24 100644 --- a/iphone/Classes/TiUITableView.m +++ b/iphone/Classes/TiUITableView.m @@ -2390,7 +2390,6 @@ - (void)viewResignFocus - (void)viewGetFocus { -#if IS_SDK_IOS_11 if (isSearchBarInNavigation) { id proxy = [(TiViewProxy *)self.proxy parent]; while ([proxy isKindOfClass:[TiViewProxy class]] && ![proxy isKindOfClass:[TiWindowProxy class]]) { @@ -2406,7 +2405,6 @@ - (void)viewGetFocus controller.navigationItem.searchController = searchController; } } -#endif if (!hideOnSearch && isSearched && self.searchedString && ![searchController isActive]) { isSearched = NO; searchController.searchBar.text = self.searchedString; diff --git a/iphone/Classes/TiUIWebView.h b/iphone/Classes/TiUIWebView.h index b4e8fd66b05..b99accb5ddd 100644 --- a/iphone/Classes/TiUIWebView.h +++ b/iphone/Classes/TiUIWebView.h @@ -39,13 +39,11 @@ @end -#if IS_SDK_IOS_11 @interface WebAppProtocolHandler : NSObject { } + (NSString *)specialProtocolScheme; @end -#endif #endif diff --git a/iphone/Classes/TiUIWebView.m b/iphone/Classes/TiUIWebView.m index db175a609db..12680d2290d 100644 --- a/iphone/Classes/TiUIWebView.m +++ b/iphone/Classes/TiUIWebView.m @@ -75,13 +75,11 @@ - (WKWebView *)webView [config setUserContentController:controller]; -#if IS_SDK_IOS_11 if ([TiUtils isIOSVersionOrGreater:@"11.0"]) { if (![WKWebView handlesURLScheme:[WebAppProtocolHandler specialProtocolScheme]]) { [config setURLSchemeHandler:[[WebAppProtocolHandler alloc] init] forURLScheme:[WebAppProtocolHandler specialProtocolScheme]]; } } -#endif _willHandleTouches = [TiUtils boolValue:[[self proxy] valueForKey:@"willHandleTouches"] def:YES]; @@ -1372,7 +1370,6 @@ - (NSHTTPCookie *)cookieForString:(NSString *)cookieStr @end -#if IS_SDK_IOS_11 @implementation WebAppProtocolHandler + (NSString *)specialProtocolScheme @@ -1423,6 +1420,5 @@ - (void)webView:(nonnull WKWebView *)webView stopURLSchemeTask:(nonnull id= 110000 -#define IS_SDK_IOS_11 true -#else -#define IS_SDK_IOS_11 false -#endif diff --git a/iphone/package.json b/iphone/package.json index f9c8871e911..4eec5405084 100644 --- a/iphone/package.json +++ b/iphone/package.json @@ -19,8 +19,8 @@ "minIosVersion": "9.0", "minWatchosVersion": "2.0", "vendorDependencies": { - "xcode": ">=8.0 <=11.x", - "ios sdk": ">=9.0 <=13.x" + "xcode": ">=9.0 <=11.x", + "ios sdk": ">=10.0 <=13.x" }, "repository": { "type": "git",