diff --git a/iphone/Maps/Bridging-Header.h b/iphone/Maps/Bridging-Header.h index d281c8c450..e8beb0e565 100644 --- a/iphone/Maps/Bridging-Header.h +++ b/iphone/Maps/Bridging-Header.h @@ -2,7 +2,10 @@ // Use this file to import your target's public headers that you would like to expose to Swift. // +#import #import +#import +#import #import #import #import @@ -17,6 +20,7 @@ #import "private.h" #import "AppInfo.h" +#import "MWMAuthorizationViewModel.h" #import "MWMAvailableAreaAffectDirection.h" #import "MWMBanner.h" #import "MWMBottomMenuViewController.h" diff --git a/iphone/Maps/Categories/Bundle+Init.swift b/iphone/Maps/Categories/Bundle+Init.swift index ff1a9358e2..18a044800f 100644 --- a/iphone/Maps/Categories/Bundle+Init.swift +++ b/iphone/Maps/Categories/Bundle+Init.swift @@ -2,4 +2,9 @@ extension Bundle { @objc func load(viewClass: AnyClass, owner: Any? = nil, options: [AnyHashable: Any]? = nil) -> [Any]? { return loadNibNamed(toString(viewClass), owner: owner, options: options) } + + @objc func load(plist: String) -> Dictionary? { + guard let path = Bundle.main.path(forResource: plist, ofType: "plist") else { return nil } + return NSDictionary(contentsOfFile: path) as? [String: AnyObject] + } } diff --git a/iphone/Maps/Classes/MapsAppDelegate.mm b/iphone/Maps/Classes/MapsAppDelegate.mm index e1c4ee2f78..d047189fe0 100644 --- a/iphone/Maps/Classes/MapsAppDelegate.mm +++ b/iphone/Maps/Classes/MapsAppDelegate.mm @@ -377,6 +377,9 @@ using namespace osm_auth_ios; [MWMRouter restoreRouteIfNeeded]; + [GIDSignIn sharedInstance].clientID = + [[NSBundle mainBundle] loadWithPlist:@"GoogleService-Info"][@"CLIENT_ID"]; + return returnValue; } @@ -793,6 +796,12 @@ using namespace osm_auth_ios; return YES; } + BOOL isGoogleURL = [[GIDSignIn sharedInstance] handleURL:url + sourceApplication:sourceApplication + annotation:annotation]; + if (isGoogleURL) + return YES; + return [[FBSDKApplicationDelegate sharedInstance] application:application openURL:url sourceApplication:sourceApplication diff --git a/iphone/Maps/GoogleService-Info.plist b/iphone/Maps/GoogleService-Info.plist new file mode 100644 index 0000000000..24d513d1d8 --- /dev/null +++ b/iphone/Maps/GoogleService-Info.plist @@ -0,0 +1,28 @@ + + + + + CLIENT_ID + 1033279251462-k2pp753lp1f39dacjn0pkurcc8pbbvsi.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.1033279251462-k2pp753lp1f39dacjn0pkurcc8pbbvsi + PLIST_VERSION + 1 + BUNDLE_ID + com.mapswithme.full + PROJECT_ID + mapsmeauth + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:1033279251462:ios:c25db4ed9dea3619 + + \ No newline at end of file diff --git a/iphone/Maps/MAPSME.plist b/iphone/Maps/MAPSME.plist index 96dea939db..f3348fc359 100644 --- a/iphone/Maps/MAPSME.plist +++ b/iphone/Maps/MAPSME.plist @@ -72,6 +72,14 @@ mapswithmepro + + CFBundleTypeRole + Editor + CFBundleURLSchemes + + com.googleusercontent.apps.1033279251462-k2pp753lp1f39dacjn0pkurcc8pbbvsi + + CFBundleVersion 0 diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index 49934c9c5e..ed876ecc3f 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -153,6 +153,9 @@ 340708861F2B863500029ECC /* MWMNavigationDashboardManager+Entity.mm in Sources */ = {isa = PBXBuildFile; fileRef = 340708831F2B863500029ECC /* MWMNavigationDashboardManager+Entity.mm */; }; 340837131B7243CE00B5C185 /* MWMActivityViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 340837121B7243CE00B5C185 /* MWMActivityViewController.mm */; }; 340837161B72451A00B5C185 /* MWMShareActivityItem.mm in Sources */ = {isa = PBXBuildFile; fileRef = 340837151B72451A00B5C185 /* MWMShareActivityItem.mm */; }; + 3408963E1F83CEDE00BC7117 /* MWMAuthorizationViewModel.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3408963D1F83CEDE00BC7117 /* MWMAuthorizationViewModel.mm */; }; + 3408963F1F83CEDE00BC7117 /* MWMAuthorizationViewModel.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3408963D1F83CEDE00BC7117 /* MWMAuthorizationViewModel.mm */; }; + 340896401F83CEDE00BC7117 /* MWMAuthorizationViewModel.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3408963D1F83CEDE00BC7117 /* MWMAuthorizationViewModel.mm */; }; 340B33C51F3AEFDB00A8C1B4 /* MWMRouter+RouteManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 340B33C41F3AEFDB00A8C1B4 /* MWMRouter+RouteManager.mm */; }; 340B33C61F3AEFDB00A8C1B4 /* MWMRouter+RouteManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 340B33C41F3AEFDB00A8C1B4 /* MWMRouter+RouteManager.mm */; }; 340B33C71F3AEFDB00A8C1B4 /* MWMRouter+RouteManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 340B33C41F3AEFDB00A8C1B4 /* MWMRouter+RouteManager.mm */; }; @@ -303,6 +306,15 @@ 3457C4251F680F1900028233 /* String+BoundingRect.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3457C4241F680F1900028233 /* String+BoundingRect.swift */; }; 3457C4261F680F1900028233 /* String+BoundingRect.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3457C4241F680F1900028233 /* String+BoundingRect.swift */; }; 3457C4271F680F1900028233 /* String+BoundingRect.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3457C4241F680F1900028233 /* String+BoundingRect.swift */; }; + 345E8F4E1F83984500A826CC /* GoogleSignIn.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 347D15C71F82362900E86251 /* GoogleSignIn.framework */; }; + 345E8F4F1F83984500A826CC /* GoogleSignInDependencies.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 347D15C81F82362900E86251 /* GoogleSignInDependencies.framework */; }; + 345E8F501F83985500A826CC /* GoogleSignIn.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 347D15C71F82362900E86251 /* GoogleSignIn.framework */; }; + 345E8F511F83985500A826CC /* GoogleSignInDependencies.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 347D15C81F82362900E86251 /* GoogleSignInDependencies.framework */; }; + 345E8F521F83985600A826CC /* GoogleSignIn.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 347D15C71F82362900E86251 /* GoogleSignIn.framework */; }; + 345E8F531F83985600A826CC /* GoogleSignInDependencies.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 347D15C81F82362900E86251 /* GoogleSignInDependencies.framework */; }; + 345E8F541F839E6400A826CC /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 345E8F4D1F83976800A826CC /* GoogleService-Info.plist */; }; + 345E8F551F839E6C00A826CC /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 345E8F4D1F83976800A826CC /* GoogleService-Info.plist */; }; + 345E8F561F839E6D00A826CC /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 345E8F4D1F83976800A826CC /* GoogleService-Info.plist */; }; 3462258E1DDC5DBA001E8752 /* MWMSearchNoResultsAlert.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3462258D1DDC5DBA001E8752 /* MWMSearchNoResultsAlert.mm */; }; 3462258F1DDC5DBA001E8752 /* MWMSearchNoResultsAlert.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3462258D1DDC5DBA001E8752 /* MWMSearchNoResultsAlert.mm */; }; 346225911DDC5FBA001E8752 /* MWMSearchNoResultsAlert.xib in Resources */ = {isa = PBXBuildFile; fileRef = 346225901DDC5FBA001E8752 /* MWMSearchNoResultsAlert.xib */; }; @@ -535,6 +547,24 @@ 34BBD6461F8264980070CA50 /* GoogleSignIn.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 34BBD6451F8264980070CA50 /* GoogleSignIn.bundle */; }; 34BBD6471F82649D0070CA50 /* GoogleSignIn.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 34BBD6451F8264980070CA50 /* GoogleSignIn.bundle */; }; 34BBD6481F82649E0070CA50 /* GoogleSignIn.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 34BBD6451F8264980070CA50 /* GoogleSignIn.bundle */; }; + 34BBD64B1F826DB10070CA50 /* AuthorizationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34BBD64A1F826DB10070CA50 /* AuthorizationViewController.swift */; }; + 34BBD64C1F826DB10070CA50 /* AuthorizationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34BBD64A1F826DB10070CA50 /* AuthorizationViewController.swift */; }; + 34BBD64D1F826DB10070CA50 /* AuthorizationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34BBD64A1F826DB10070CA50 /* AuthorizationViewController.swift */; }; + 34BBD6571F826F810070CA50 /* AuthorizationTransitioningManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34BBD6561F826F810070CA50 /* AuthorizationTransitioningManager.swift */; }; + 34BBD6581F826F810070CA50 /* AuthorizationTransitioningManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34BBD6561F826F810070CA50 /* AuthorizationTransitioningManager.swift */; }; + 34BBD6591F826F810070CA50 /* AuthorizationTransitioningManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34BBD6561F826F810070CA50 /* AuthorizationTransitioningManager.swift */; }; + 34BBD65B1F826FD30070CA50 /* AuthorizationiPhonePresentationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34BBD65A1F826FD30070CA50 /* AuthorizationiPhonePresentationController.swift */; }; + 34BBD65C1F826FD30070CA50 /* AuthorizationiPhonePresentationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34BBD65A1F826FD30070CA50 /* AuthorizationiPhonePresentationController.swift */; }; + 34BBD65D1F826FD30070CA50 /* AuthorizationiPhonePresentationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34BBD65A1F826FD30070CA50 /* AuthorizationiPhonePresentationController.swift */; }; + 34BBD65F1F8270360070CA50 /* AuthorizationiPadPresentationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34BBD65E1F8270360070CA50 /* AuthorizationiPadPresentationController.swift */; }; + 34BBD6601F8270360070CA50 /* AuthorizationiPadPresentationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34BBD65E1F8270360070CA50 /* AuthorizationiPadPresentationController.swift */; }; + 34BBD6611F8270360070CA50 /* AuthorizationiPadPresentationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34BBD65E1F8270360070CA50 /* AuthorizationiPadPresentationController.swift */; }; + 34BBD6631F8270AC0070CA50 /* AuthorizationTransitioning.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34BBD6621F8270AC0070CA50 /* AuthorizationTransitioning.swift */; }; + 34BBD6641F8270AC0070CA50 /* AuthorizationTransitioning.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34BBD6621F8270AC0070CA50 /* AuthorizationTransitioning.swift */; }; + 34BBD6651F8270AC0070CA50 /* AuthorizationTransitioning.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34BBD6621F8270AC0070CA50 /* AuthorizationTransitioning.swift */; }; + 34BBD6671F8273350070CA50 /* AuthorizationViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34BBD6661F8273350070CA50 /* AuthorizationViewController.xib */; }; + 34BBD6681F8273350070CA50 /* AuthorizationViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34BBD6661F8273350070CA50 /* AuthorizationViewController.xib */; }; + 34BBD6691F8273350070CA50 /* AuthorizationViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34BBD6661F8273350070CA50 /* AuthorizationViewController.xib */; }; 34BC72241B0DECAE0012A34B /* MWMMapViewControlsManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34BC72111B0DECAE0012A34B /* MWMMapViewControlsManager.mm */; }; 34BF0CC61C31304A00D097EB /* MWMAuthorizationCommon.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34BF0CC51C31304A00D097EB /* MWMAuthorizationCommon.mm */; }; 34BF0CC71C31304A00D097EB /* MWMAuthorizationCommon.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34BF0CC51C31304A00D097EB /* MWMAuthorizationCommon.mm */; }; @@ -1864,6 +1894,8 @@ 340837121B7243CE00B5C185 /* MWMActivityViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMActivityViewController.mm; sourceTree = ""; }; 340837141B72451A00B5C185 /* MWMShareActivityItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMShareActivityItem.h; sourceTree = ""; }; 340837151B72451A00B5C185 /* MWMShareActivityItem.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMShareActivityItem.mm; sourceTree = ""; }; + 3408963C1F83CEDE00BC7117 /* MWMAuthorizationViewModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMAuthorizationViewModel.h; sourceTree = ""; }; + 3408963D1F83CEDE00BC7117 /* MWMAuthorizationViewModel.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMAuthorizationViewModel.mm; sourceTree = ""; }; 340B33C41F3AEFDB00A8C1B4 /* MWMRouter+RouteManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "MWMRouter+RouteManager.mm"; sourceTree = ""; }; 340DC82B1C4E72C700EAA2CC /* liboauthcpp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liboauthcpp.a; path = "../../../omim-xcode-build/Debug/liboauthcpp.a"; sourceTree = ""; }; 340E1EE41E2F614400CE49BF /* Authorization.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Authorization.storyboard; sourceTree = ""; }; @@ -1944,6 +1976,7 @@ 34570A3A1B13222600E6D4FD /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; 34574A651E3B85F80061E839 /* ThemeManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ThemeManager.swift; sourceTree = ""; }; 3457C4241F680F1900028233 /* String+BoundingRect.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+BoundingRect.swift"; sourceTree = ""; }; + 345E8F4D1F83976800A826CC /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 3462258C1DDC5DB9001E8752 /* MWMSearchNoResultsAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchNoResultsAlert.h; sourceTree = ""; }; 3462258D1DDC5DBA001E8752 /* MWMSearchNoResultsAlert.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMSearchNoResultsAlert.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 346225901DDC5FBA001E8752 /* MWMSearchNoResultsAlert.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMSearchNoResultsAlert.xib; sourceTree = ""; }; @@ -2082,6 +2115,12 @@ 34B924401DC8A29C0008D971 /* MWMMailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMMailViewController.h; sourceTree = ""; }; 34B924411DC8A29C0008D971 /* MWMMailViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMMailViewController.mm; sourceTree = ""; }; 34BBD6451F8264980070CA50 /* GoogleSignIn.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = GoogleSignIn.bundle; path = 3party/GoogleSignIn/GoogleSignIn.bundle; sourceTree = ""; }; + 34BBD64A1F826DB10070CA50 /* AuthorizationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthorizationViewController.swift; sourceTree = ""; }; + 34BBD6561F826F810070CA50 /* AuthorizationTransitioningManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthorizationTransitioningManager.swift; sourceTree = ""; }; + 34BBD65A1F826FD30070CA50 /* AuthorizationiPhonePresentationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthorizationiPhonePresentationController.swift; sourceTree = ""; }; + 34BBD65E1F8270360070CA50 /* AuthorizationiPadPresentationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthorizationiPadPresentationController.swift; sourceTree = ""; }; + 34BBD6621F8270AC0070CA50 /* AuthorizationTransitioning.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthorizationTransitioning.swift; sourceTree = ""; }; + 34BBD6661F8273350070CA50 /* AuthorizationViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AuthorizationViewController.xib; sourceTree = ""; }; 34BC72101B0DECAE0012A34B /* MWMMapViewControlsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMMapViewControlsManager.h; sourceTree = ""; }; 34BC72111B0DECAE0012A34B /* MWMMapViewControlsManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMMapViewControlsManager.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 34BF0CC51C31304A00D097EB /* MWMAuthorizationCommon.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMAuthorizationCommon.mm; sourceTree = ""; }; @@ -2721,11 +2760,13 @@ 340474F01E08199D00C92850 /* Crashlytics.framework in Frameworks */, 34570A3B1B13222600E6D4FD /* libz.dylib in Frameworks */, 34D8087E1E79361A002F0584 /* AlamofireImage.framework in Frameworks */, + 345E8F501F83985500A826CC /* GoogleSignIn.framework in Frameworks */, 340474FF1E08199D00C92850 /* libFlurry_7.8.2.a in Frameworks */, 67B78B4A1E422E2E0018E590 /* MessageUI.framework in Frameworks */, 3404750E1E08199E00C92850 /* MyTrackerSDK.framework in Frameworks */, 67B78B481E422E2E0018E590 /* MobileCoreServices.framework in Frameworks */, 34F4098B1E9E221700E57AC0 /* FBAudienceNetwork.framework in Frameworks */, + 345E8F511F83985500A826CC /* GoogleSignInDependencies.framework in Frameworks */, 67B78B561E4233480018E590 /* AdSupport.framework in Frameworks */, 3432E1781E49B3A2008477E9 /* Bolts.framework in Frameworks */, 340474F31E08199D00C92850 /* Fabric.framework in Frameworks */, @@ -2738,6 +2779,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 345E8F4E1F83984500A826CC /* GoogleSignIn.framework in Frameworks */, + 345E8F4F1F83984500A826CC /* GoogleSignInDependencies.framework in Frameworks */, 4586D0E71F4813AB00DF9CE5 /* libmwm_diff.a in Frameworks */, 4586D0C41F48121A00DF9CE5 /* libbsdiff.a in Frameworks */, 34E6F2DB1F459C05008E14F9 /* GLKit.framework in Frameworks */, @@ -2823,11 +2866,13 @@ 340474F21E08199D00C92850 /* Crashlytics.framework in Frameworks */, 849CF7861DE842290024A8A5 /* libz.dylib in Frameworks */, 34D8087F1E79361B002F0584 /* AlamofireImage.framework in Frameworks */, + 345E8F521F83985600A826CC /* GoogleSignIn.framework in Frameworks */, 340475011E08199D00C92850 /* libFlurry_7.8.2.a in Frameworks */, 67B78B501E422E300018E590 /* MessageUI.framework in Frameworks */, 340475101E08199E00C92850 /* MyTrackerSDK.framework in Frameworks */, 67B78B4E1E422E300018E590 /* MobileCoreServices.framework in Frameworks */, 34F4098D1E9E221700E57AC0 /* FBAudienceNetwork.framework in Frameworks */, + 345E8F531F83985600A826CC /* GoogleSignInDependencies.framework in Frameworks */, 67B78B571E42334A0018E590 /* AdSupport.framework in Frameworks */, 3432E17A1E49B3A2008477E9 /* Bolts.framework in Frameworks */, 340474F51E08199D00C92850 /* Fabric.framework in Frameworks */, @@ -2916,6 +2961,7 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( + 345E8F4D1F83976800A826CC /* GoogleService-Info.plist */, 34BBD6451F8264980070CA50 /* GoogleSignIn.bundle */, 6B653B931C7F2DE4007BEFC5 /* cuisine-strings */, 4A300ED31C6DCFD400140018 /* countries-strings */, @@ -3629,6 +3675,21 @@ path = InputValidators; sourceTree = ""; }; + 34BBD6491F826BD50070CA50 /* Authorization */ = { + isa = PBXGroup; + children = ( + 34BBD65E1F8270360070CA50 /* AuthorizationiPadPresentationController.swift */, + 34BBD65A1F826FD30070CA50 /* AuthorizationiPhonePresentationController.swift */, + 34BBD6621F8270AC0070CA50 /* AuthorizationTransitioning.swift */, + 34BBD6561F826F810070CA50 /* AuthorizationTransitioningManager.swift */, + 34BBD64A1F826DB10070CA50 /* AuthorizationViewController.swift */, + 34BBD6661F8273350070CA50 /* AuthorizationViewController.xib */, + 3408963C1F83CEDE00BC7117 /* MWMAuthorizationViewModel.h */, + 3408963D1F83CEDE00BC7117 /* MWMAuthorizationViewModel.mm */, + ); + path = Authorization; + sourceTree = ""; + }; 34BC72091B0DECAE0012A34B /* MapViewControls */ = { isa = PBXGroup; children = ( @@ -4073,6 +4134,7 @@ F6E2FBFB1E097B9F0083EBEC /* UI */ = { isa = PBXGroup; children = ( + 34BBD6491F826BD50070CA50 /* Authorization */, 34E7760D1F14B165003040B3 /* AvailableArea */, 3432E17F1E49BEFA008477E9 /* Ads */, 34574A601E3B5B2A0061E839 /* Appearance */, @@ -4904,6 +4966,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 345E8F541F839E6400A826CC /* GoogleService-Info.plist in Resources */, 34EE25A11EFA68BC00F870AB /* PPViatorCarouselCell.xib in Resources */, 450703091E9E6CF000E8C029 /* local_ads_symbols.txt in Resources */, F6C0E62D1EF80F9000A4EFAA /* MWMUGCCommentCell.xib in Resources */, @@ -5070,6 +5133,7 @@ 5605022F1B6211E100169CAD /* sound-strings in Resources */, F69018BC1E9F7CB600B3C10B /* MWMAutoupdateController.xib in Resources */, F6150E2C1EF95234000B955D /* MWMUGCReviewController.xib in Resources */, + 34BBD6671F8273350070CA50 /* AuthorizationViewController.xib in Resources */, FAAEA7D1161BD26600CCD661 /* synonyms.txt in Resources */, 3476B8E01BFDD33A00874594 /* tts-how-to-set-up-voice-img in Resources */, 3476B8DC1BFDD30B00874594 /* tts-how-to-set-up-voice.html in Resources */, @@ -5177,6 +5241,7 @@ F6E2FD681E097BA00083EBEC /* MWMMapDownloaderPlaceTableViewCell.xib in Resources */, F6E2FD6E1E097BA00083EBEC /* MWMMapDownloaderSubplaceTableViewCell.xib in Resources */, F6150E551EFA7352000B955D /* MWUGCCommentsController.xib in Resources */, + 345E8F551F839E6C00A826CC /* GoogleService-Info.plist in Resources */, F6E2FD741E097BA00083EBEC /* MWMMapDownloaderTableViewCell.xib in Resources */, 349A13851DEC138C00C7DB60 /* MWMMobileInternetAlert.xib in Resources */, 34D3B04B1E389D05004100F9 /* MWMNoteCell.xib in Resources */, @@ -5254,6 +5319,7 @@ 6741A9421BF340DE002C974C /* sound-strings in Resources */, F69018BD1E9F7CB600B3C10B /* MWMAutoupdateController.xib in Resources */, F6150E2D1EF95234000B955D /* MWMUGCReviewController.xib in Resources */, + 34BBD6681F8273350070CA50 /* AuthorizationViewController.xib in Resources */, 6741A97D1BF340DE002C974C /* synonyms.txt in Resources */, 3476B8E11BFDD33A00874594 /* tts-how-to-set-up-voice-img in Resources */, 3476B8DD1BFDD30B00874594 /* tts-how-to-set-up-voice.html in Resources */, @@ -5361,6 +5427,7 @@ F6E2FD631E097BA00083EBEC /* MWMMapDownloaderLargeCountryTableViewCell.xib in Resources */, F6E2FD691E097BA00083EBEC /* MWMMapDownloaderPlaceTableViewCell.xib in Resources */, F6150E561EFA7352000B955D /* MWUGCCommentsController.xib in Resources */, + 345E8F561F839E6D00A826CC /* GoogleService-Info.plist in Resources */, F6E2FD6F1E097BA00083EBEC /* MWMMapDownloaderSubplaceTableViewCell.xib in Resources */, F6E2FD751E097BA00083EBEC /* MWMMapDownloaderTableViewCell.xib in Resources */, 34D3B04C1E389D05004100F9 /* MWMNoteCell.xib in Resources */, @@ -5438,6 +5505,7 @@ 849CF5EA1DE842290024A8A5 /* sound-strings in Resources */, F69018BE1E9F7CB600B3C10B /* MWMAutoupdateController.xib in Resources */, F6150E2E1EF95234000B955D /* MWMUGCReviewController.xib in Resources */, + 34BBD6691F8273350070CA50 /* AuthorizationViewController.xib in Resources */, 849CF64C1DE842290024A8A5 /* synonyms.txt in Resources */, 849CF6111DE842290024A8A5 /* tts-how-to-set-up-voice-img in Resources */, 849CF6281DE842290024A8A5 /* tts-how-to-set-up-voice.html in Resources */, @@ -5588,6 +5656,7 @@ F6E2FF531E097BA00083EBEC /* MWMHelpController.mm in Sources */, F6E2FF591E097BA00083EBEC /* MWMNightModeController.mm in Sources */, 3454D7B81E07F045004AF2AD /* CALayer+RuntimeAttributes.mm in Sources */, + 3408963E1F83CEDE00BC7117 /* MWMAuthorizationViewModel.mm in Sources */, F6E2FE1E1E097BA00083EBEC /* MWMOpeningHoursCommon.mm in Sources */, F6BC1E521ACBF98600EF0360 /* MWMFacebookAlert.mm in Sources */, F6E2FF5C1E097BA00083EBEC /* MWMRecentTrackSettingsController.mm in Sources */, @@ -5610,6 +5679,7 @@ F6E2FE181E097BA00083EBEC /* MWMOpeningHoursTimeSpanTableViewCell.mm in Sources */, F6E2FDEB1E097BA00083EBEC /* MWMOpeningHoursAddClosedTableViewCell.mm in Sources */, F6150E511EFA7352000B955D /* MWUGCCommentsController.mm in Sources */, + 34BBD64B1F826DB10070CA50 /* AuthorizationViewController.swift in Sources */, F6E2FE0F1E097BA00083EBEC /* MWMOpeningHoursTableViewCell.mm in Sources */, 341522BF1B666A550077AA8F /* MWMAPIBarView.mm in Sources */, 3423609A1F34585A00AFE44D /* RouteManagerFooterView.swift in Sources */, @@ -5694,6 +5764,7 @@ 346DB8331E5C4F6700E3123E /* GalleryViewController.swift in Sources */, F6E2FDFD1E097BA00083EBEC /* MWMOpeningHoursClosedSpanTableViewCell.mm in Sources */, F6E2FEDB1E097BA00083EBEC /* MWMSearchManager+Filter.mm in Sources */, + 34BBD6571F826F810070CA50 /* AuthorizationTransitioningManager.swift in Sources */, 34F4073A1E9E1AFF00E57AC0 /* MopubBanner.swift in Sources */, 34943BB61E26222300B14F84 /* WelcomeProtocol.swift in Sources */, F6E2FD5E1E097BA00083EBEC /* MWMMapDownloaderLargeCountryTableViewCell.mm in Sources */, @@ -5749,9 +5820,11 @@ F6150E471EFA5C94000B955D /* UGCTextReviewCell.swift in Sources */, F6E2FD4F1E097BA00083EBEC /* MWMMapDownloaderAdsTableViewCell.mm in Sources */, F6E2FE871E097BA00083EBEC /* MWMPlacePageRegularCell.mm in Sources */, + 34BBD6631F8270AC0070CA50 /* AuthorizationTransitioning.swift in Sources */, 34D3AFE91E378AF1004100F9 /* UINib+Init.swift in Sources */, F6E2FD7F1E097BA00083EBEC /* MWMMapDownloaderExtendedDataSourceWithAds.mm in Sources */, 34F407311E9E1AFF00E57AC0 /* BannerType.swift in Sources */, + 34BBD65B1F826FD30070CA50 /* AuthorizationiPhonePresentationController.swift in Sources */, F63AF5121EA6250F00A1DB98 /* FilterCollectionHolderCell.swift in Sources */, F6BD33871B62412E00F2CE18 /* MWMNavigationDashboardEntity.mm in Sources */, FA36B80D15403A4F004560CC /* BookmarksVC.mm in Sources */, @@ -5828,6 +5901,7 @@ F6E2FE781E097BA00083EBEC /* MWMOpeningHoursLayoutHelper.mm in Sources */, F6BD1D201CA412920047B8E8 /* MWMOsmAuthAlert.mm in Sources */, F6B97B261CD0CA990009B612 /* MWMBookmarkNameCell.mm in Sources */, + 34BBD65F1F8270360070CA50 /* AuthorizationiPadPresentationController.swift in Sources */, 349993FA1F388F970064CFBE /* RouteManageriPadPresentationController.swift in Sources */, F6E2FD7C1E097BA00083EBEC /* MWMMapDownloaderExtendedDataSource.mm in Sources */, F6E2FED21E097BA00083EBEC /* MWMSearchHotelsFilterViewController.mm in Sources */, @@ -5935,6 +6009,7 @@ F6E2FF5A1E097BA00083EBEC /* MWMNightModeController.mm in Sources */, 340708581F28F1F000029ECC /* MWMTaxiCollectionLayout.mm in Sources */, 6741A9A51BF340DE002C974C /* MWMShareActivityItem.mm in Sources */, + 3408963F1F83CEDE00BC7117 /* MWMAuthorizationViewModel.mm in Sources */, F6E2FE1F1E097BA00083EBEC /* MWMOpeningHoursCommon.mm in Sources */, 3454D7B91E07F045004AF2AD /* CALayer+RuntimeAttributes.mm in Sources */, F6E2FF5D1E097BA00083EBEC /* MWMRecentTrackSettingsController.mm in Sources */, @@ -5957,6 +6032,7 @@ F6E2FE191E097BA00083EBEC /* MWMOpeningHoursTimeSpanTableViewCell.mm in Sources */, F6E2FDEC1E097BA00083EBEC /* MWMOpeningHoursAddClosedTableViewCell.mm in Sources */, F6150E521EFA7352000B955D /* MWUGCCommentsController.mm in Sources */, + 34BBD64C1F826DB10070CA50 /* AuthorizationViewController.swift in Sources */, F6E2FE101E097BA00083EBEC /* MWMOpeningHoursTableViewCell.mm in Sources */, 6741A9B01BF340DE002C974C /* MapsAppDelegate.mm in Sources */, 3423609B1F34585A00AFE44D /* RouteManagerFooterView.swift in Sources */, @@ -6041,6 +6117,7 @@ 34F4073B1E9E1AFF00E57AC0 /* MopubBanner.swift in Sources */, F6E2FF481E097BA00083EBEC /* SettingsTableViewSelectableCell.swift in Sources */, F6E2FF271E097BA00083EBEC /* MWMSearchTabButtonsView.mm in Sources */, + 34BBD6581F826F810070CA50 /* AuthorizationTransitioningManager.swift in Sources */, F6558DA21E642CC0002203AE /* MWMFacilitiesController.mm in Sources */, 349D1ACF1E2E325B004A2006 /* MWMBottomMenuCollectionViewCell.mm in Sources */, 347E1A891F1F5DD7002BF7A8 /* CianItemModel.swift in Sources */, @@ -6096,9 +6173,11 @@ F6E2FD501E097BA00083EBEC /* MWMMapDownloaderAdsTableViewCell.mm in Sources */, F6E2FE881E097BA00083EBEC /* MWMPlacePageRegularCell.mm in Sources */, F6E2FD801E097BA00083EBEC /* MWMMapDownloaderExtendedDataSourceWithAds.mm in Sources */, + 34BBD6641F8270AC0070CA50 /* AuthorizationTransitioning.swift in Sources */, 34D3AFEA1E378AF1004100F9 /* UINib+Init.swift in Sources */, 34F407321E9E1AFF00E57AC0 /* BannerType.swift in Sources */, F63AF5131EA6250F00A1DB98 /* FilterCollectionHolderCell.swift in Sources */, + 34BBD65C1F826FD30070CA50 /* AuthorizationiPhonePresentationController.swift in Sources */, 6741A9F11BF340DE002C974C /* MWMNavigationDashboardEntity.mm in Sources */, 56C74C391C74A3BC00B71B9F /* MWMInputEmailValidator.mm in Sources */, 6741A9F51BF340DE002C974C /* BookmarksVC.mm in Sources */, @@ -6175,6 +6254,7 @@ F6E2FE791E097BA00083EBEC /* MWMOpeningHoursLayoutHelper.mm in Sources */, F6B97B271CD0CA990009B612 /* MWMBookmarkNameCell.mm in Sources */, 34ABA6211C2D517500FE1BEC /* MWMInputValidator.mm in Sources */, + 34BBD6601F8270360070CA50 /* AuthorizationiPadPresentationController.swift in Sources */, 349993FB1F388F970064CFBE /* RouteManageriPadPresentationController.swift in Sources */, F6E2FD7D1E097BA00083EBEC /* MWMMapDownloaderExtendedDataSource.mm in Sources */, F6E2FED31E097BA00083EBEC /* MWMSearchHotelsFilterViewController.mm in Sources */, @@ -6282,6 +6362,7 @@ F6E2FF551E097BA00083EBEC /* MWMHelpController.mm in Sources */, 340708591F28F1F000029ECC /* MWMTaxiCollectionLayout.mm in Sources */, F6E2FF5B1E097BA00083EBEC /* MWMNightModeController.mm in Sources */, + 340896401F83CEDE00BC7117 /* MWMAuthorizationViewModel.mm in Sources */, 849CF6841DE842290024A8A5 /* MWMShareActivityItem.mm in Sources */, F6E2FE201E097BA00083EBEC /* MWMOpeningHoursCommon.mm in Sources */, 849CF6891DE842290024A8A5 /* MWMFacebookAlert.mm in Sources */, @@ -6304,6 +6385,7 @@ F6E2FDF91E097BA00083EBEC /* MWMOpeningHoursAllDayTableViewCell.mm in Sources */, F6E2FE1A1E097BA00083EBEC /* MWMOpeningHoursTimeSpanTableViewCell.mm in Sources */, F6E2FDED1E097BA00083EBEC /* MWMOpeningHoursAddClosedTableViewCell.mm in Sources */, + 34BBD64D1F826DB10070CA50 /* AuthorizationViewController.swift in Sources */, F6150E531EFA7352000B955D /* MWUGCCommentsController.mm in Sources */, F6E2FE111E097BA00083EBEC /* MWMOpeningHoursTableViewCell.mm in Sources */, 3423609C1F34585A00AFE44D /* RouteManagerFooterView.swift in Sources */, @@ -6388,6 +6470,7 @@ F6E2FDFF1E097BA00083EBEC /* MWMOpeningHoursClosedSpanTableViewCell.mm in Sources */, F6E2FEDD1E097BA00083EBEC /* MWMSearchManager+Filter.mm in Sources */, 34F4073C1E9E1AFF00E57AC0 /* MopubBanner.swift in Sources */, + 34BBD6591F826F810070CA50 /* AuthorizationTransitioningManager.swift in Sources */, 34943BB81E26222300B14F84 /* WelcomeProtocol.swift in Sources */, F6E2FD601E097BA00083EBEC /* MWMMapDownloaderLargeCountryTableViewCell.mm in Sources */, F6558DA31E642CC0002203AE /* MWMFacilitiesController.mm in Sources */, @@ -6443,9 +6526,11 @@ F6150E491EFA5C94000B955D /* UGCTextReviewCell.swift in Sources */, F6E2FD511E097BA00083EBEC /* MWMMapDownloaderAdsTableViewCell.mm in Sources */, F6E2FE891E097BA00083EBEC /* MWMPlacePageRegularCell.mm in Sources */, + 34BBD6651F8270AC0070CA50 /* AuthorizationTransitioning.swift in Sources */, 34D3AFEB1E378AF1004100F9 /* UINib+Init.swift in Sources */, F6E2FD811E097BA00083EBEC /* MWMMapDownloaderExtendedDataSourceWithAds.mm in Sources */, 34F407331E9E1AFF00E57AC0 /* BannerType.swift in Sources */, + 34BBD65D1F826FD30070CA50 /* AuthorizationiPhonePresentationController.swift in Sources */, F63AF5141EA6250F00A1DB98 /* FilterCollectionHolderCell.swift in Sources */, 849CF6EB1DE842290024A8A5 /* MWMAPIBar.mm in Sources */, 3404755D1E081A4600C92850 /* MWMLocationManager.mm in Sources */, @@ -6522,6 +6607,7 @@ F6E2FE7A1E097BA00083EBEC /* MWMOpeningHoursLayoutHelper.mm in Sources */, 849CF7251DE842290024A8A5 /* MWMMapViewControlsManager.mm in Sources */, 849CF7281DE842290024A8A5 /* MWMOsmAuthAlert.mm in Sources */, + 34BBD6611F8270360070CA50 /* AuthorizationiPadPresentationController.swift in Sources */, 349993FC1F388F970064CFBE /* RouteManageriPadPresentationController.swift in Sources */, F6E2FD7E1E097BA00083EBEC /* MWMMapDownloaderExtendedDataSource.mm in Sources */, F6E2FED41E097BA00083EBEC /* MWMSearchHotelsFilterViewController.mm in Sources */, @@ -6717,6 +6803,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/3party/MoPubSDK/AdNetworkSupport/Facebook/SDK", + "$(PROJECT_DIR)/3party/GoogleSignIn", ); LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "xc dbg"; @@ -6730,6 +6817,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/3party/MoPubSDK/AdNetworkSupport/Facebook/SDK", + "$(PROJECT_DIR)/3party/GoogleSignIn", ); LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "xc rel"; @@ -6743,6 +6831,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/3party/MoPubSDK/AdNetworkSupport/Facebook/SDK", + "$(PROJECT_DIR)/3party/GoogleSignIn", ); LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "xc dbg"; @@ -6756,6 +6845,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/3party/MoPubSDK/AdNetworkSupport/Facebook/SDK", + "$(PROJECT_DIR)/3party/GoogleSignIn", ); LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "xc beta"; @@ -6769,6 +6859,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/3party/MoPubSDK/AdNetworkSupport/Facebook/SDK", + "$(PROJECT_DIR)/3party/GoogleSignIn", ); LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "xc rel"; @@ -6782,6 +6873,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/3party/MoPubSDK/AdNetworkSupport/Facebook/SDK", + "$(PROJECT_DIR)/3party/GoogleSignIn", ); LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "xc pf"; @@ -6794,6 +6886,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/3party/MoPubSDK/AdNetworkSupport/Facebook/SDK", + "$(PROJECT_DIR)/3party/GoogleSignIn", ); LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( @@ -6848,6 +6941,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/3party/MoPubSDK/AdNetworkSupport/Facebook/SDK", + "$(PROJECT_DIR)/3party/GoogleSignIn", ); LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( @@ -6902,6 +6996,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/3party/MoPubSDK/AdNetworkSupport/Facebook/SDK", + "$(PROJECT_DIR)/3party/GoogleSignIn", ); LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( @@ -6956,6 +7051,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/3party/MoPubSDK/AdNetworkSupport/Facebook/SDK", + "$(PROJECT_DIR)/3party/GoogleSignIn", ); LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( @@ -7010,6 +7106,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/3party/MoPubSDK/AdNetworkSupport/Facebook/SDK", + "$(PROJECT_DIR)/3party/GoogleSignIn", ); LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( @@ -7064,6 +7161,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/3party/MoPubSDK/AdNetworkSupport/Facebook/SDK", + "$(PROJECT_DIR)/3party/GoogleSignIn", ); LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( @@ -7171,6 +7269,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/3party/MoPubSDK/AdNetworkSupport/Facebook/SDK", + "$(PROJECT_DIR)/3party/GoogleSignIn", ); LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( @@ -7274,6 +7373,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/3party/MoPubSDK/AdNetworkSupport/Facebook/SDK", + "$(PROJECT_DIR)/3party/GoogleSignIn", ); LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( @@ -7379,6 +7479,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/3party/MoPubSDK/AdNetworkSupport/Facebook/SDK", + "$(PROJECT_DIR)/3party/GoogleSignIn", ); LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( @@ -7485,6 +7586,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/3party/MoPubSDK/AdNetworkSupport/Facebook/SDK", + "$(PROJECT_DIR)/3party/GoogleSignIn", ); LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( @@ -7591,6 +7693,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/3party/MoPubSDK/AdNetworkSupport/Facebook/SDK", + "$(PROJECT_DIR)/3party/GoogleSignIn", ); LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( @@ -7698,6 +7801,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/3party/MoPubSDK/AdNetworkSupport/Facebook/SDK", + "$(PROJECT_DIR)/3party/GoogleSignIn", ); LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( diff --git a/iphone/Maps/UI/Authorization/AuthorizationTransitioning.swift b/iphone/Maps/UI/Authorization/AuthorizationTransitioning.swift new file mode 100644 index 0000000000..ac9f7280e2 --- /dev/null +++ b/iphone/Maps/UI/Authorization/AuthorizationTransitioning.swift @@ -0,0 +1,35 @@ +final class AuthorizationTransitioning: NSObject, UIViewControllerAnimatedTransitioning { + private let isPresentation: Bool + + init(isPresentation: Bool) { + self.isPresentation = isPresentation + super.init() + } + + func transitionDuration(using _: UIViewControllerContextTransitioning?) -> TimeInterval { + return kDefaultAnimationDuration + } + + func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { + guard let fromVC = transitionContext.viewController(forKey: .from), + let toVC = transitionContext.viewController(forKey: .to) else { return } + + let animatingVC = isPresentation ? toVC : fromVC + guard let animatingView = animatingVC.view else { return } + + let finalFrameForVC = transitionContext.finalFrame(for: animatingVC) + var initialFrameForVC = finalFrameForVC + initialFrameForVC.origin.y += initialFrameForVC.size.height + + let initialFrame = isPresentation ? initialFrameForVC : finalFrameForVC + let finalFrame = isPresentation ? finalFrameForVC : initialFrameForVC + + animatingView.frame = initialFrame + + UIView.animate(withDuration: transitionDuration(using: transitionContext), + animations: { animatingView.frame = finalFrame }, + completion: { _ in + transitionContext.completeTransition(true) + }) + } +} diff --git a/iphone/Maps/UI/Authorization/AuthorizationTransitioningManager.swift b/iphone/Maps/UI/Authorization/AuthorizationTransitioningManager.swift new file mode 100644 index 0000000000..96e9e6d0d8 --- /dev/null +++ b/iphone/Maps/UI/Authorization/AuthorizationTransitioningManager.swift @@ -0,0 +1,33 @@ +final class AuthorizationTransitioningManager: NSObject, UIViewControllerTransitioningDelegate { + private var popoverSourceView: UIView! + private var permittedArrowDirections: UIPopoverArrowDirection! + + init(popoverSourceView: UIView?, permittedArrowDirections: UIPopoverArrowDirection?) { + self.popoverSourceView = popoverSourceView + self.permittedArrowDirections = permittedArrowDirections + super.init() + } + + func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source _: UIViewController) -> UIPresentationController? { + return alternative(iPhone: { () -> UIPresentationController in + AuthorizationiPhonePresentationController(presentedViewController: presented, + presenting: presenting) + }, + iPad: { () -> UIPresentationController in + let popover = AuthorizationiPadPresentationController(presentedViewController: presented, + presenting: presenting) + popover.sourceView = self.popoverSourceView + popover.sourceRect = self.popoverSourceView.bounds + popover.permittedArrowDirections = self.permittedArrowDirections + return popover + })() + } + + func animationController(forPresented _: UIViewController, presenting _: UIViewController, source _: UIViewController) -> UIViewControllerAnimatedTransitioning? { + return AuthorizationTransitioning(isPresentation: true) + } + + func animationController(forDismissed _: UIViewController) -> UIViewControllerAnimatedTransitioning? { + return AuthorizationTransitioning(isPresentation: false) + } +} diff --git a/iphone/Maps/UI/Authorization/AuthorizationViewController.swift b/iphone/Maps/UI/Authorization/AuthorizationViewController.swift new file mode 100644 index 0000000000..b2cd828099 --- /dev/null +++ b/iphone/Maps/UI/Authorization/AuthorizationViewController.swift @@ -0,0 +1,151 @@ +import FBSDKCoreKit +import FBSDKLoginKit +import GoogleSignIn + +@objc(MWMAuthorizationViewController) +final class AuthorizationViewController: MWMViewController { + typealias ViewModel = MWMAuthorizationViewModel + + private let transitioningManager: AuthorizationTransitioningManager + + lazy var chromeView: UIView = { + let view = UIView() + view.backgroundColor = UIColor.blackStatusBarBackground() + return view + }() + + weak var containerView: UIView! { + didSet { + containerView.insertSubview(chromeView, at: 0) + } + } + + @IBOutlet private weak var titleLabel: UILabel! { + didSet { + titleLabel.font = UIFont.bold22() + titleLabel.textColor = UIColor.blackPrimaryText() + titleLabel.text = L("profile_authorization_title") + } + } + + @IBOutlet weak var separator: UIView! { + didSet { + separator.backgroundColor = UIColor.blackDividers() + } + } + + @IBOutlet private weak var textLabel: UILabel! { + didSet { + textLabel.font = UIFont.regular14() + textLabel.textColor = UIColor.blackSecondaryText() + textLabel.text = L("profile_authorization_message") + } + } + + @IBOutlet private weak var googleButton: UIButton! { + didSet { + let layer = googleButton.layer + layer.cornerRadius = 8 + layer.borderWidth = 1 + layer.borderColor = UIColor.blackDividers().cgColor + googleButton.clipsToBounds = true + googleButton.setTitle("Google", for: .normal) + googleButton.setTitleColor(UIColor.blackPrimaryText(), for: .normal) + googleButton.titleLabel?.font = UIFont.bold14() + let gid = GIDSignIn.sharedInstance()! + gid.delegate = self + gid.uiDelegate = self + } + } + + @IBAction func googleSignIn() { + GIDSignIn.sharedInstance().signIn() + } + + private lazy var facebookButton: FBSDKLoginButton = { + let button = FBSDKLoginButton() + button.delegate = self + button.loginBehavior = .systemAccount + button.setAttributedTitle(NSAttributedString(string: "Facebook"), for: .normal) + button.readPermissions = ["public_profile", "email"] + return button + }() + + @IBOutlet private weak var facebookButtonHolder: UIView! { + didSet { + facebookButton.translatesAutoresizingMaskIntoConstraints = false + facebookButtonHolder.addSubview(facebookButton) + facebookButton.removeConstraints(facebookButton.constraints) + addConstraints(v1: facebookButton, v2: facebookButtonHolder) + facebookButtonHolder.layer.cornerRadius = 8 + facebookButtonHolder.clipsToBounds = true + } + } + + private func addConstraints(v1: UIView, v2: UIView) { + [NSLayoutAttribute.top, .bottom, .left, .right].forEach { + NSLayoutConstraint(item: v1, attribute: $0, relatedBy: .equal, toItem: v2, attribute: $0, multiplier: 1, constant: 0).isActive = true + } + } + + @objc init(popoverSourceView: UIView? = nil, permittedArrowDirections: UIPopoverArrowDirection = .unknown) { + transitioningManager = AuthorizationTransitioningManager(popoverSourceView: popoverSourceView, permittedArrowDirections: permittedArrowDirections) + super.init(nibName: toString(type(of: self)), bundle: nil) + transitioningDelegate = transitioningManager + modalPresentationStyle = .custom + } + + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + } + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + + let fbImage = facebookButton.subviews.first(where: { $0 is UIImageView && $0.frame != facebookButton.frame }) + fbImage?.frame = CGRect(x: 16, y: 8, width: 24, height: 24) + } + + @IBAction func onCancel() { + dismiss(animated: true, completion: nil) + } + + private func process(error: Error) { + textLabel.text = L("profile_authorization_error") + Crashlytics.sharedInstance().recordError(error) + } + + private func process(token: String, type: MWMSocialTokenType) { + ViewModel.authenticate(withToken: token, type: type) + onCancel() + } +} + +extension AuthorizationViewController: FBSDKLoginButtonDelegate { + func loginButton(_: FBSDKLoginButton!, didCompleteWith result: FBSDKLoginManagerLoginResult!, error: Error!) { + if let error = error { + process(error: error) + } else if let result = result { + process(token: result.token.tokenString, type: .facebook) + } + } + + func loginButtonDidLogOut(_: FBSDKLoginButton!) {} +} + +extension AuthorizationViewController: GIDSignInUIDelegate { +} + +extension AuthorizationViewController: GIDSignInDelegate { + func sign(_: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) { + if let error = error { + process(error: error) + } else { + process(token: user.authentication.idToken, type: .google) + } + } +} diff --git a/iphone/Maps/UI/Authorization/AuthorizationViewController.xib b/iphone/Maps/UI/Authorization/AuthorizationViewController.xib new file mode 100644 index 0000000000..ad31ea8e41 --- /dev/null +++ b/iphone/Maps/UI/Authorization/AuthorizationViewController.xib @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iphone/Maps/UI/Authorization/AuthorizationiPadPresentationController.swift b/iphone/Maps/UI/Authorization/AuthorizationiPadPresentationController.swift new file mode 100644 index 0000000000..db5cb35321 --- /dev/null +++ b/iphone/Maps/UI/Authorization/AuthorizationiPadPresentationController.swift @@ -0,0 +1,36 @@ +final class AuthorizationiPadPresentationController: UIPopoverPresentationController { + private let chromeView = UIView() + + override func containerViewWillLayoutSubviews() { + super.containerViewWillLayoutSubviews() + (presentedViewController as? AuthorizationViewController)?.chromeView.frame = containerView!.bounds + } + + override func presentationTransitionWillBegin() { + super.presentationTransitionWillBegin() + guard let presentedViewController = presentedViewController as? AuthorizationViewController, + let coordinator = presentedViewController.transitionCoordinator, + let containerView = containerView else { return } + + presentedViewController.containerView = containerView + presentedViewController.chromeView.frame = containerView.bounds + presentedViewController.chromeView.alpha = 0 + + coordinator.animate(alongsideTransition: { _ in + presentedViewController.chromeView.alpha = 1 + }, completion: nil) + } + + override func dismissalTransitionWillBegin() { + super.dismissalTransitionWillBegin() + guard let presentedViewController = presentedViewController as? AuthorizationViewController, + let coordinator = presentedViewController.transitionCoordinator, + let presentedView = presentedView else { return } + + coordinator.animate(alongsideTransition: { _ in + presentedViewController.chromeView.alpha = 0 + }, completion: { _ in + presentedView.removeFromSuperview() + }) + } +} diff --git a/iphone/Maps/UI/Authorization/AuthorizationiPhonePresentationController.swift b/iphone/Maps/UI/Authorization/AuthorizationiPhonePresentationController.swift new file mode 100644 index 0000000000..3390cc738d --- /dev/null +++ b/iphone/Maps/UI/Authorization/AuthorizationiPhonePresentationController.swift @@ -0,0 +1,36 @@ +final class AuthorizationiPhonePresentationController: UIPresentationController { + override func containerViewWillLayoutSubviews() { + super.containerViewWillLayoutSubviews() + (presentedViewController as? AuthorizationViewController)?.chromeView.frame = containerView!.bounds + presentedView?.frame = frameOfPresentedViewInContainerView + } + + override func presentationTransitionWillBegin() { + super.presentationTransitionWillBegin() + guard let presentedViewController = presentedViewController as? AuthorizationViewController, + let coordinator = presentedViewController.transitionCoordinator, + let containerView = containerView else { return } + + containerView.addSubview(presentedView!) + presentedViewController.containerView = containerView + presentedViewController.chromeView.frame = containerView.bounds + presentedViewController.chromeView.alpha = 0 + + coordinator.animate(alongsideTransition: { _ in + presentedViewController.chromeView.alpha = 1 + }, completion: nil) + } + + override func dismissalTransitionWillBegin() { + super.dismissalTransitionWillBegin() + guard let presentedViewController = presentedViewController as? AuthorizationViewController, + let coordinator = presentedViewController.transitionCoordinator, + let presentedView = presentedView else { return } + + coordinator.animate(alongsideTransition: { _ in + presentedViewController.chromeView.alpha = 0 + }, completion: { _ in + presentedView.removeFromSuperview() + }) + } +} diff --git a/iphone/Maps/UI/Authorization/MWMAuthorizationViewModel.h b/iphone/Maps/UI/Authorization/MWMAuthorizationViewModel.h new file mode 100644 index 0000000000..7bf441ad5a --- /dev/null +++ b/iphone/Maps/UI/Authorization/MWMAuthorizationViewModel.h @@ -0,0 +1,11 @@ +typedef NS_ENUM(NSInteger, MWMSocialTokenType) { + MWMSocialTokenTypeGoogle, + MWMSocialTokenTypeFacebook +}; + +@interface MWMAuthorizationViewModel : NSObject + ++ (BOOL)isAuthenticated; ++ (void)authenticateWithToken:(NSString* _Nonnull)token type:(enum MWMSocialTokenType)type; + +@end diff --git a/iphone/Maps/UI/Authorization/MWMAuthorizationViewModel.mm b/iphone/Maps/UI/Authorization/MWMAuthorizationViewModel.mm new file mode 100644 index 0000000000..44dc9b9220 --- /dev/null +++ b/iphone/Maps/UI/Authorization/MWMAuthorizationViewModel.mm @@ -0,0 +1,41 @@ +#import "MWMAuthorizationViewModel.h" +#import +#import + +#include "Framework.h" + +@implementation MWMAuthorizationViewModel + ++ (BOOL)isAuthenticated { + if (GetFramework().GetUser().IsAuthenticated()) return YES; + + auto googleToken = [GIDSignIn sharedInstance].currentUser.authentication.idToken; + if (googleToken) { + [self authenticateWithToken:googleToken type:MWMSocialTokenTypeGoogle]; + return YES; + } + + auto fbToken = [FBSDKAccessToken currentAccessToken].tokenString; + if (fbToken) { + [self authenticateWithToken:fbToken type:MWMSocialTokenTypeFacebook]; + return YES; + } + + return NO; +} + ++ (void)authenticateWithToken:(NSString* _Nonnull)token type:(enum MWMSocialTokenType)type { + auto& user = GetFramework().GetUser(); + User::SocialTokenType socialTokenType; + switch (type) { + case MWMSocialTokenTypeGoogle: + socialTokenType = User::SocialTokenType::Google; + break; + case MWMSocialTokenTypeFacebook: + socialTokenType = User::SocialTokenType::Facebook; + break; + } + user.Authenticate(token.UTF8String, socialTokenType); +} + +@end