diff --git a/iphone/Maps/Categories/UIKitCategories.mm b/iphone/Maps/Categories/UIKitCategories.mm index 71fb30ac23..56c8d06e99 100644 --- a/iphone/Maps/Categories/UIKitCategories.mm +++ b/iphone/Maps/Categories/UIKitCategories.mm @@ -106,7 +106,7 @@ { NSString * urlString = @"https://itunes.apple.com/app/id510623322?action=write-review"; NSURL * url = [NSURL URLWithString:urlString]; - [self openURL:url]; + [self openURL:url options:@{} completionHandler:nil]; } @end diff --git a/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.h b/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.h index b6d7693dc9..6f0c094f08 100644 --- a/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.h +++ b/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.h @@ -10,7 +10,6 @@ - (nonnull instancetype)initWithViewController:(nonnull UIViewController *)viewController; - (void)presentRoutingMigrationAlertWithOkBlock:(nonnull MWMVoidBlock)okBlock; - (void)presentRateAlert; -- (void)presentFacebookAlert; - (void)presentPoint2PointAlertWithOkBlock:(nonnull MWMVoidBlock)okBlock needToRebuild:(BOOL)needToRebuild; - (void)presentRoutingDisclaimerAlertWithOkBlock:(nonnull nonnull MWMVoidBlock)block; diff --git a/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm b/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm index 1c0e85dfa4..32ae34922e 100644 --- a/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm +++ b/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm @@ -62,7 +62,6 @@ static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController [self displayAlert:[MWMAlert point2PointAlertWithOkBlock:okBlock needToRebuild:needToRebuild]]; } -- (void)presentFacebookAlert { [self displayAlert:[MWMAlert facebookAlert]]; } - (void)presentLocationServiceNotSupportedAlert { [self displayAlert:[MWMAlert locationServiceNotSupportedAlert]]; diff --git a/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.h b/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.h index e6c0c2b255..893eefe181 100644 --- a/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.h +++ b/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.h @@ -5,7 +5,6 @@ + (MWMAlert *)routingMigrationAlertWithOkBlock:(MWMVoidBlock)okBlock; + (MWMAlert *)rateAlert; -+ (MWMAlert *)facebookAlert; + (MWMAlert *)locationAlert; + (MWMAlert *)routingDisclaimerAlertWithOkBlock:(MWMVoidBlock)block; + (MWMAlert *)disabledLocationAlert; diff --git a/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm b/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm index 46fb5d94b7..03ef59a759 100644 --- a/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm @@ -4,7 +4,6 @@ #import "MWMDefaultAlert.h" #import "MWMDownloadTransitMapAlert.h" #import "MWMEditorViralAlert.h" -#import "MWMFacebookAlert.h" #import "MWMLocationAlert.h" #import "MWMOsmAuthAlert.h" #import "MWMPlaceDoesntExistAlert.h" @@ -17,7 +16,6 @@ + (MWMAlert *)rateAlert { return [MWMRateAlert alert]; } + (MWMAlert *)locationAlert { return [MWMLocationAlert alert]; } -+ (MWMAlert *)facebookAlert { return [MWMFacebookAlert alert]; } + (MWMAlert *)point2PointAlertWithOkBlock:(MWMVoidBlock)block needToRebuild:(BOOL)needToRebuild { return [MWMDefaultAlert point2PointAlertWithOkBlock:block needToRebuild:needToRebuild]; diff --git a/iphone/Maps/Classes/CustomAlert/FacebookAlert/MWMFacebookAlert.h b/iphone/Maps/Classes/CustomAlert/FacebookAlert/MWMFacebookAlert.h deleted file mode 100644 index 2310af139b..0000000000 --- a/iphone/Maps/Classes/CustomAlert/FacebookAlert/MWMFacebookAlert.h +++ /dev/null @@ -1,7 +0,0 @@ -#import "MWMAlert.h" - -@interface MWMFacebookAlert : MWMAlert - -+ (MWMFacebookAlert *)alert; - -@end diff --git a/iphone/Maps/Classes/CustomAlert/FacebookAlert/MWMFacebookAlert.mm b/iphone/Maps/Classes/CustomAlert/FacebookAlert/MWMFacebookAlert.mm deleted file mode 100644 index ab053e8d9d..0000000000 --- a/iphone/Maps/Classes/CustomAlert/FacebookAlert/MWMFacebookAlert.mm +++ /dev/null @@ -1,51 +0,0 @@ -#import "MWMAlertViewController.h" -#import "MWMFacebookAlert.h" -#import "Statistics.h" -#import - -#import "3party/Alohalytics/src/alohalytics_objc.h" - -static NSString * const kFacebookAlertNibName = @"MWMFacebookAlert"; -static NSString * const kFacebookAppName = @"https://fb.me/958251974218933"; -static NSString * const kFacebookURL = @"http://www.facebook.com/MapsWithMe"; -static NSString * const kFacebookScheme = @"fb://profile/111923085594432"; -static NSString * const kFacebookAlertPreviewImage = @"http://maps.me/images/fb_app_invite_banner.png"; -static NSString * const kFacebookInviteEventName = @"facebookInviteEvent"; -extern NSString * const kUDAlreadySharedKey; - -static NSString * const kStatisticsEvent = @"Facebook Alert"; - -@implementation MWMFacebookAlert - -+ (MWMFacebookAlert *)alert -{ - [Statistics logEvent:kStatisticsEvent withParameters:@{kStatAction : kStatOpen}]; - MWMFacebookAlert * alert = - [NSBundle.mainBundle loadNibNamed:kFacebookAlertNibName owner:self options:nil].firstObject; - return alert; -} - -#pragma mark - Actions - -- (IBAction)shareButtonTap:(id)sender -{ - [Statistics logEvent:kStatisticsEvent withParameters:@{kStatAction : kStatApply}]; - [Alohalytics logEvent:kFacebookInviteEventName withValue:@"shareTap"]; - [self close:nil]; - [NSUserDefaults.standardUserDefaults setBool:YES forKey:kUDAlreadySharedKey]; - [NSUserDefaults.standardUserDefaults synchronize]; - - FBSDKAppInviteContent * const content = [[FBSDKAppInviteContent alloc] init]; - content.appLinkURL = [NSURL URLWithString:kFacebookAppName]; - content.appInvitePreviewImageURL = [NSURL URLWithString:kFacebookAlertPreviewImage]; - [FBSDKAppInviteDialog showFromViewController:self.alertController.ownerViewController withContent:content delegate:nil]; -} - -- (IBAction)notNowButtonTap:(id)sender -{ - [Statistics logEvent:kStatisticsEvent withParameters:@{kStatAction : kStatClose}]; - [Alohalytics logEvent:kFacebookInviteEventName withValue:@"notNowTap"]; - [self close:nil]; -} - -@end diff --git a/iphone/Maps/Classes/CustomAlert/FacebookAlert/MWMFacebookAlert.xib b/iphone/Maps/Classes/CustomAlert/FacebookAlert/MWMFacebookAlert.xib deleted file mode 100644 index b2087357bc..0000000000 --- a/iphone/Maps/Classes/CustomAlert/FacebookAlert/MWMFacebookAlert.xib +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - HelveticaNeue - HelveticaNeue-Medium - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/iphone/Maps/Classes/CustomAlert/LocationAlert/MWMLocationAlert.mm b/iphone/Maps/Classes/CustomAlert/LocationAlert/MWMLocationAlert.mm index 65b44b85d1..0e398e849b 100644 --- a/iphone/Maps/Classes/CustomAlert/LocationAlert/MWMLocationAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/LocationAlert/MWMLocationAlert.mm @@ -30,7 +30,7 @@ static NSString * const kStatisticsEvent = @"Location Alert"; NSURL * url = [NSURL URLWithString:UIApplicationOpenSettingsURLString]; UIApplication * a = UIApplication.sharedApplication; if ([a canOpenURL:url]) - [a openURL:url]; + [a openURL:url options:@{} completionHandler:nil]; }]; } diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/APIBar/MWMAPIBar.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/APIBar/MWMAPIBar.mm index 0456c1930b..1baaa943a8 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/APIBar/MWMAPIBar.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/APIBar/MWMAPIBar.mm @@ -53,7 +53,7 @@ static NSString * const kKeyPath = @"subviews"; auto & bmManager = f.GetBookmarkManager(); bmManager.GetEditSession().ClearGroup(UserMark::Type::API); NSURL * url = [NSURL URLWithString:@(f.GetApiDataHolder().GetGlobalBackUrl().c_str())]; - [UIApplication.sharedApplication openURL:url]; + [UIApplication.sharedApplication openURL:url options:@{} completionHandler:nil]; } @end diff --git a/iphone/Maps/Classes/MapsAppDelegate.mm b/iphone/Maps/Classes/MapsAppDelegate.mm index 64ef267c95..0ee1732b07 100644 --- a/iphone/Maps/Classes/MapsAppDelegate.mm +++ b/iphone/Maps/Classes/MapsAppDelegate.mm @@ -401,8 +401,7 @@ using namespace osm_auth_ios; [GIDSignIn sharedInstance].clientID = [[NSBundle mainBundle] loadWithPlist:@"GoogleService-Info"][@"CLIENT_ID"]; - if (@available(iOS 10, *)) - [UNUserNotificationCenter currentNotificationCenter].delegate = self; + [UNUserNotificationCenter currentNotificationCenter].delegate = self; if ([MWMFrameworkHelper canUseNetwork]) { [[SubscriptionManager shared] validate]; @@ -941,66 +940,20 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(showRateAlert) object:nil]; [self performSelector:@selector(showRateAlert) withObject:nil afterDelay:30.0]; } - else if ([self shouldShowFacebookAlert]) - { - [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(showFacebookAlert) object:nil]; - [self performSelector:@selector(showFacebookAlert) withObject:nil afterDelay:30.0]; - } -} - -- (void)showAlert:(BOOL)isRate -{ - if (!Platform::IsConnected() || [MWMRouter isRoutingActive]) - return; - - if (isRate) - [[MWMAlertViewController activeAlertController] presentRateAlert]; - else - [[MWMAlertViewController activeAlertController] presentFacebookAlert]; - [NSUserDefaults.standardUserDefaults - setObject:NSDate.date - forKey:isRate ? kUDLastRateRequestDate : kUDLastShareRequstDate]; -} - -#pragma mark - Facebook - -- (void)showFacebookAlert { [self showAlert:NO]; } -- (BOOL)shouldShowFacebookAlert -{ - NSUInteger const kMaximumSessionCountForShowingShareAlert = 50; - NSUserDefaults const * const standartDefaults = NSUserDefaults.standardUserDefaults; - if ([standartDefaults boolForKey:kUDAlreadySharedKey]) - return NO; - - NSUInteger const sessionCount = [standartDefaults integerForKey:kUDSessionsCountKey]; - if (sessionCount > kMaximumSessionCountForShowingShareAlert) - return NO; - - NSDate * const lastShareRequestDate = [standartDefaults objectForKey:kUDLastShareRequstDate]; - NSUInteger const daysFromLastShareRequest = - [MapsAppDelegate daysBetweenNowAndDate:lastShareRequestDate]; - if (lastShareRequestDate != nil && daysFromLastShareRequest == 0) - return NO; - - if (sessionCount == 30 || sessionCount == kMaximumSessionCountForShowingShareAlert) - return YES; - - if (self.userIsNew) - { - if (sessionCount == 12) - return YES; - } - else - { - if (sessionCount == 5) - return YES; - } - return NO; } #pragma mark - Rate -- (void)showRateAlert { [self showAlert:YES]; } +- (void)showRateAlert +{ + if (!Platform::IsConnected() || [MWMRouter isRoutingActive]) + return; + + [[MWMAlertViewController activeAlertController] presentRateAlert]; + [NSUserDefaults.standardUserDefaults setObject:NSDate.date + forKey:kUDLastRateRequestDate]; +} + - (BOOL)shouldShowRateAlert { NSUInteger const kMaximumSessionCountForShowingAlert = 21; diff --git a/iphone/Maps/Common/WebViewController.mm b/iphone/Maps/Common/WebViewController.mm index a4fc379544..217ce49531 100644 --- a/iphone/Maps/Common/WebViewController.mm +++ b/iphone/Maps/Common/WebViewController.mm @@ -164,7 +164,7 @@ && ![inRequest.URL.scheme isEqualToString:@"applewebdata"]) // do not try to open local links in Safari { NSURL * url = [inRequest URL]; - [UIApplication.sharedApplication openURL:url]; + [UIApplication.sharedApplication openURL:url options:@{} completionHandler:nil]; decisionHandler(WKNavigationActionPolicyCancel); return; } diff --git a/iphone/Maps/Core/Notifications/MWMPushNotifications.mm b/iphone/Maps/Core/Notifications/MWMPushNotifications.mm index 384a54f970..49ac38eb6e 100644 --- a/iphone/Maps/Core/Notifications/MWMPushNotifications.mm +++ b/iphone/Maps/Core/Notifications/MWMPushNotifications.mm @@ -70,7 +70,7 @@ NSString * const kPushDeviceTokenLogEvent = @"iOSPushDeviceToken"; return NO; NSURL * url = [NSURL URLWithString:openLink]; - [app openURL:url]; + [app openURL:url options:@{} completionHandler:nil]; return YES; } diff --git a/iphone/Maps/Core/Routing/MWMRouter.mm b/iphone/Maps/Core/Routing/MWMRouter.mm index f59db60bec..d0796ece08 100644 --- a/iphone/Maps/Core/Routing/MWMRouter.mm +++ b/iphone/Maps/Core/Routing/MWMRouter.mm @@ -153,7 +153,7 @@ void logPointEvent(MWMRoutePoint * point, NSString * eventType) } [taxiDataSource taxiURL:^(NSURL * url) { - [UIApplication.sharedApplication openURL:url]; + [UIApplication.sharedApplication openURL:url options:@{} completionHandler:nil]; }]; } diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index b4d64a7f95..32fa33d956 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -474,14 +474,12 @@ 6741A9881BF340DE002C974C /* MWMAPIBarView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 341C2A5A1B720B8A00AD41A1 /* MWMAPIBarView.xib */; }; 6741A98B1BF340DE002C974C /* MWMCircularProgress.xib in Resources */ = {isa = PBXBuildFile; fileRef = 349A35771B53D4C9009677EE /* MWMCircularProgress.xib */; }; 6741A9901BF340DE002C974C /* resources-mdpi_dark in Resources */ = {isa = PBXBuildFile; fileRef = 4A7D89C21B2EBF3B00AC843E /* resources-mdpi_dark */; }; - 6741A9911BF340DE002C974C /* MWMFacebookAlert.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6BC1E531ACBF9AB00EF0360 /* MWMFacebookAlert.xib */; }; 6741A9951BF340DE002C974C /* MWMDownloaderDialogCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F64F4B6E1B46A5380081A24A /* MWMDownloaderDialogCell.xib */; }; 6741A9981BF340DE002C974C /* resources-xhdpi_clear in Resources */ = {isa = PBXBuildFile; fileRef = 4A23D1591B8B4DD700D4EB6F /* resources-xhdpi_clear */; }; 6741A9991BF340DE002C974C /* MWMAlertViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F64F19831AB81A00006EAF7E /* MWMAlertViewController.xib */; }; 6741A99F1BF340DE002C974C /* 07_roboto_medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FAF30A94173AB23900818BF6 /* 07_roboto_medium.ttf */; }; 6741A9A31BF340DE002C974C /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.mm */; }; 6741A9A51BF340DE002C974C /* MWMShareActivityItem.mm in Sources */ = {isa = PBXBuildFile; fileRef = 340837151B72451A00B5C185 /* MWMShareActivityItem.mm */; }; - 6741A9A81BF340DE002C974C /* MWMFacebookAlert.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6BC1E511ACBF98600EF0360 /* MWMFacebookAlert.mm */; }; 6741A9A91BF340DE002C974C /* MWMDefaultAlert.mm in Sources */ = {isa = PBXBuildFile; fileRef = F64F198B1AB81A00006EAF7E /* MWMDefaultAlert.mm */; }; 6741A9B01BF340DE002C974C /* MapsAppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* MapsAppDelegate.mm */; }; 6741A9B11BF340DE002C974C /* MWMAPIBarView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 341522BE1B666A550077AA8F /* MWMAPIBarView.mm */; }; @@ -1695,9 +1693,6 @@ F6BBF2C41B4FFB72000CF8E2 /* MWMLocationAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMLocationAlert.h; sourceTree = ""; }; F6BBF2C51B4FFB72000CF8E2 /* MWMLocationAlert.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMLocationAlert.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; F6BBF2C71B4FFB8C000CF8E2 /* MWMLocationAlert.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMLocationAlert.xib; sourceTree = ""; }; - F6BC1E501ACBF98600EF0360 /* MWMFacebookAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMFacebookAlert.h; sourceTree = ""; }; - F6BC1E511ACBF98600EF0360 /* MWMFacebookAlert.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMFacebookAlert.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - F6BC1E531ACBF9AB00EF0360 /* MWMFacebookAlert.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMFacebookAlert.xib; sourceTree = ""; }; F6BD1D1E1CA412920047B8E8 /* MWMOsmAuthAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMOsmAuthAlert.h; sourceTree = ""; }; F6BD1D1F1CA412920047B8E8 /* MWMOsmAuthAlert.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMOsmAuthAlert.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; F6BD1D221CA412E30047B8E8 /* MWMOsmAuthAlert.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMOsmAuthAlert.xib; sourceTree = ""; }; @@ -3584,7 +3579,6 @@ F6BBF2C31B4FFB56000CF8E2 /* LocationAlert */, 346B42A81DD5E3D20094EBEE /* LocationNotFoundAlert */, F64F19801AB81A00006EAF7E /* AlertController */, - F6BC1E4F1ACBF97000EF0360 /* FacebookAlert */, F64F19841AB81A00006EAF7E /* BaseAlert */, F61579301AC2CE760032D8E9 /* RateAlert */, F64F19871AB81A00006EAF7E /* DefaultAlert */, @@ -3741,16 +3735,6 @@ path = LocationAlert; sourceTree = ""; }; - F6BC1E4F1ACBF97000EF0360 /* FacebookAlert */ = { - isa = PBXGroup; - children = ( - F6BC1E501ACBF98600EF0360 /* MWMFacebookAlert.h */, - F6BC1E511ACBF98600EF0360 /* MWMFacebookAlert.mm */, - F6BC1E531ACBF9AB00EF0360 /* MWMFacebookAlert.xib */, - ); - path = FacebookAlert; - sourceTree = ""; - }; F6BD1D1D1CA412700047B8E8 /* AuthAlert */ = { isa = PBXGroup; children = ( @@ -4654,7 +4638,6 @@ F64D9CA31C899C760063FA30 /* MWMEditorViralAlert.xib in Resources */, 340FDC0A2031C39E00F140AD /* BMCPermissionsPendingCell.xib in Resources */, 346DB8311E5C4F6700E3123E /* GalleryItemViewController.xib in Resources */, - 6741A9911BF340DE002C974C /* MWMFacebookAlert.xib in Resources */, 6741A96D1BF340DE002C974C /* MWMLocationAlert.xib in Resources */, 3406FA191C6E0D8F00E9FAD2 /* MWMMapDownloadDialog.xib in Resources */, A630D1EA207CA95900976DEA /* Localizable.stringsdict in Resources */, @@ -4872,7 +4855,6 @@ F6664BFA1E6459CB00E703C2 /* PPFacilityCell.swift in Sources */, 348B926D1FF3B5E100379009 /* UIView+Animation.swift in Sources */, F6E2FDE91E097BA00083EBEC /* MWMObjectsCategorySelectorController.mm in Sources */, - 6741A9A81BF340DE002C974C /* MWMFacebookAlert.mm in Sources */, 34AB665F1FC5AA330078E451 /* TransportTransitIntermediatePoint.swift in Sources */, 34B846A82029E8110081ECCD /* BMCDefaultViewModel.swift in Sources */, 470F5A7F2189C30800754295 /* InAppPurchase.swift in Sources */, @@ -5540,7 +5522,6 @@ SWIFT_OBJC_BRIDGING_HEADER = "Bridging-Header.h"; SWIFT_OBJC_INTERFACE_HEADER_NAME = SwiftBridge.h; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = On; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; }; @@ -5591,7 +5572,6 @@ SWIFT_OBJC_BRIDGING_HEADER = "Bridging-Header.h"; SWIFT_OBJC_INTERFACE_HEADER_NAME = SwiftBridge.h; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; @@ -5645,7 +5625,6 @@ SWIFT_OBJC_BRIDGING_HEADER = "Bridging-Header.h"; SWIFT_OBJC_INTERFACE_HEADER_NAME = SwiftBridge.h; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_SWIFT3_OBJC_INFERENCE = On; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; }; diff --git a/iphone/Maps/TipsAndTricks/TutorialBlurView.swift b/iphone/Maps/TipsAndTricks/TutorialBlurView.swift index 30bc0eba53..798803456f 100644 --- a/iphone/Maps/TipsAndTricks/TutorialBlurView.swift +++ b/iphone/Maps/TipsAndTricks/TutorialBlurView.swift @@ -72,9 +72,7 @@ class TutorialBlurView: UIVisualEffectView { func animateFadeOut(_ duration: TimeInterval, completion: @escaping () -> Void) { UIView.animate(withDuration: duration, animations: { - if #available(iOS 10.0, *) { - self.effect = nil - } + self.effect = nil self.contentView.alpha = 0 }) { _ in self.contentView.backgroundColor = .clear @@ -83,15 +81,10 @@ class TutorialBlurView: UIVisualEffectView { } func animateAppearance(_ duration: TimeInterval) { - contentView.alpha = 0 - UIView.animate(withDuration: duration) { - self.contentView.alpha = 1 - if #available(iOS 10.0, *) { - self.effect = UIBlurEffect(style: UIColor.isNightMode() ? .light : .dark) - } else { - let bgColor = UIColor.isNightMode() ? UIColor.gray : UIColor.black - self.contentView.backgroundColor = bgColor.withAlphaComponent(0.5) - } + contentView.alpha = 0 + UIView.animate(withDuration: duration) { + self.contentView.alpha = 1 + self.effect = UIBlurEffect(style: UIColor.isNightMode() ? .light : .dark) } } diff --git a/iphone/Maps/UI/PlacePage/MWMPlacePageButtonsProtocol.h b/iphone/Maps/UI/PlacePage/MWMPlacePageButtonsProtocol.h index 8e4654522c..306197e9e9 100644 --- a/iphone/Maps/UI/PlacePage/MWMPlacePageButtonsProtocol.h +++ b/iphone/Maps/UI/PlacePage/MWMPlacePageButtonsProtocol.h @@ -14,7 +14,6 @@ typedef UIView * _Nullable (^MWMPlacePageButtonsDismissBlock)(NSInteger); - (void)book:(BOOL)isDescription; - (void)editBookmark; - (void)orderTaxi:(MWMPlacePageTaxiProvider)provider; -- (void)showAllReviews; - (void)showAllFacilities; - (void)showPhotoAtIndex:(NSInteger)index referenceView:(UIView * _Nullable)referenceView diff --git a/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm b/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm index 696dc2c2ed..3e8c8011a6 100644 --- a/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm +++ b/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm @@ -503,14 +503,14 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: if (!isDescription && data.isPartnerAppInstalled) { - [UIApplication.sharedApplication openURL:data.deepLink]; + [UIApplication.sharedApplication openURL:data.deepLink options:@{} completionHandler:nil]; return; } NSURL * url = isDescription ? data.sponsoredDescriptionURL : data.sponsoredURL; NSAssert(url, @"Sponsored url can't be nil!"); - [UIApplication.sharedApplication openURL:url]; + [UIApplication.sharedApplication openURL:url options:@{} completionHandler:nil]; } - (void)searchBookingHotels @@ -521,7 +521,7 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: logSponsoredEvent(data, kStatPlacePageHotelSearch); NSURL * url = data.bookingSearchURL; NSAssert(url, @"Search url can't be nil!"); - [UIApplication.sharedApplication openURL:url]; + [UIApplication.sharedApplication openURL:url options:@{} completionHandler:nil]; } - (void)openPartner @@ -532,39 +532,7 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: logSponsoredEvent(data, kStatPlacePageSponsoredActionButtonClick); NSURL * url = data.sponsoredURL; NSAssert(url, @"Partner url can't be nil!"); - [UIApplication.sharedApplication openURL:url]; -} - -- (void)call -{ - auto data = self.data; - if (!data) - return; - NSAssert(data.phoneNumber, @"Phone number can't be nil!"); - NSString * phoneNumber = [[@"telprompt:" stringByAppendingString:data.phoneNumber] - stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; - NSURL * url = [NSURL URLWithString:phoneNumber]; - [UIApplication.sharedApplication openURL:url]; -} - -- (void)apiBack -{ - auto data = self.data; - if (!data) - return; - [Statistics logEvent:kStatEventName(kStatPlacePage, kStatAPI)]; - NSURL * url = [NSURL URLWithString:data.apiURL]; - [UIApplication.sharedApplication openURL:url]; - [self.ownerViewController.apiBar back]; -} - -- (void)showAllReviews -{ - auto data = self.data; - if (!data) - return; - logSponsoredEvent(data, kStatPlacePageHotelReviews); - [UIApplication.sharedApplication openURL:data.URLToAllReviews]; + [UIApplication.sharedApplication openURL:url options:@{} completionHandler:nil]; } - (void)showPhotoAtIndex:(NSInteger)index diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageRegularCell.mm b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageRegularCell.mm index 64915ec2bc..fd248339b0 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageRegularCell.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageRegularCell.mm @@ -119,8 +119,9 @@ } - (BOOL)textView:(UITextView *)textView - shouldInteractWithURL:(NSURL *)URL - inRange:(NSRange)characterRange +shouldInteractWithURL:(NSURL *)URL + inRange:(NSRange)characterRange + interaction:(UITextItemInteraction)interaction { NSString * scheme = URL.scheme; if ([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"]) diff --git a/iphone/Maps/UI/Search/Tabs/CategoriesTab/SearchCategoriesViewController.swift b/iphone/Maps/UI/Search/Tabs/CategoriesTab/SearchCategoriesViewController.swift index 20146dd0c6..623a73956a 100644 --- a/iphone/Maps/UI/Search/Tabs/CategoriesTab/SearchCategoriesViewController.swift +++ b/iphone/Maps/UI/Search/Tabs/CategoriesTab/SearchCategoriesViewController.swift @@ -68,7 +68,7 @@ extension SearchCategoriesViewController: SearchBannerCellDelegate { assertionFailure() return } - UIApplication.shared.openURL(url) + UIApplication.shared.open(url) } func cellDidPressClose(_ cell: SearchBannerCell) { diff --git a/iphone/Maps/UI/Settings/MWMSettingsViewController.mm b/iphone/Maps/UI/Settings/MWMSettingsViewController.mm index 82ca88c292..87de5ed54e 100644 --- a/iphone/Maps/UI/Settings/MWMSettingsViewController.mm +++ b/iphone/Maps/UI/Settings/MWMSettingsViewController.mm @@ -371,7 +371,10 @@ extern NSString * const kAlohalyticsTapEventKey; } else if (cell == self.manageSubscriptionsCell) { - [UIApplication.sharedApplication openURL:[NSURL URLWithString:@"https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/manageSubscriptions"]]; + [UIApplication.sharedApplication + openURL:[NSURL URLWithString:@"https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/manageSubscriptions"] + options:@{} + completionHandler:nil]; } } diff --git a/iphone/Maps/UI/Welcome/WhatsNewController.swift b/iphone/Maps/UI/Welcome/WhatsNewController.swift index 9f54f029d9..48a26098fe 100644 --- a/iphone/Maps/UI/Welcome/WhatsNewController.swift +++ b/iphone/Maps/UI/Welcome/WhatsNewController.swift @@ -63,7 +63,7 @@ final class WhatsNewController: WelcomeViewController { @IBAction func onCta() { let config = pageConfig as! WhatsNewConfig if let url = URL(string: config.ctaButtonUrl!) { - UIApplication.shared.openURL(url) + UIApplication.shared.open(url) } else { assertionFailure() }