forked from organicmaps/organicmaps-tmp
[iOS] [refactoring] refactor authrization screen. Adjust view layout. Move cpp code to CoreApi
This commit is contained in:
parent
8eb274af96
commit
a1618769ad
20 changed files with 361 additions and 339 deletions
|
@ -51,6 +51,8 @@
|
|||
47D9019923AC236100D9364C /* MWMMapUpdateInfo+Core.h in Headers */ = {isa = PBXBuildFile; fileRef = 47D9019723AC236100D9364C /* MWMMapUpdateInfo+Core.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
47E8163623B1889C008FD836 /* MWMStorage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 47E8163423B1889B008FD836 /* MWMStorage.mm */; };
|
||||
47E8163723B188D3008FD836 /* MWMStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 47E8163523B1889B008FD836 /* MWMStorage.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
47E8164023B2B98F008FD836 /* MWMUser.h in Headers */ = {isa = PBXBuildFile; fileRef = 47E8163E23B2B98F008FD836 /* MWMUser.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
47E8164123B2B98F008FD836 /* MWMUser.mm in Sources */ = {isa = PBXBuildFile; fileRef = 47E8163F23B2B98F008FD836 /* MWMUser.mm */; };
|
||||
47EEAFF42350CEDB005CF316 /* AppInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 47EEAFF22350CEDA005CF316 /* AppInfo.mm */; };
|
||||
47EEAFF62350CF48005CF316 /* AppInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 47EEAFF32350CEDB005CF316 /* AppInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
47EEAFF72350D060005CF316 /* MWMCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 47EEAFF52350CEF6005CF316 /* MWMCommon.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
|
@ -123,6 +125,8 @@
|
|||
47D9019723AC236100D9364C /* MWMMapUpdateInfo+Core.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MWMMapUpdateInfo+Core.h"; sourceTree = "<group>"; };
|
||||
47E8163423B1889B008FD836 /* MWMStorage.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMStorage.mm; sourceTree = "<group>"; };
|
||||
47E8163523B1889B008FD836 /* MWMStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMStorage.h; sourceTree = "<group>"; };
|
||||
47E8163E23B2B98F008FD836 /* MWMUser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMUser.h; sourceTree = "<group>"; };
|
||||
47E8163F23B2B98F008FD836 /* MWMUser.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMUser.mm; sourceTree = "<group>"; };
|
||||
47EEAFF22350CEDA005CF316 /* AppInfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = AppInfo.mm; sourceTree = "<group>"; };
|
||||
47EEAFF32350CEDB005CF316 /* AppInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppInfo.h; sourceTree = "<group>"; };
|
||||
47EEAFF52350CEF6005CF316 /* MWMCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMCommon.h; sourceTree = "<group>"; };
|
||||
|
@ -185,6 +189,7 @@
|
|||
470015F12342509C00EBF03D /* CoreApi */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
47E8163D23B2B97A008FD836 /* User */,
|
||||
47F4F1F623A333280022FD56 /* Storage */,
|
||||
993F54ED237C5D1000545511 /* Promo */,
|
||||
9957FAE5237AE59C00855F48 /* Logger */,
|
||||
|
@ -319,6 +324,15 @@
|
|||
path = Search;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
47E8163D23B2B97A008FD836 /* User */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
47E8163E23B2B98F008FD836 /* MWMUser.h */,
|
||||
47E8163F23B2B98F008FD836 /* MWMUser.mm */,
|
||||
);
|
||||
path = User;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
47F4F1F623A333280022FD56 /* Storage */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
@ -408,6 +422,7 @@
|
|||
993F54F5237C5D1100545511 /* PromoAfterBookingCampaignAdapter.h in Headers */,
|
||||
479834F223426CCC00724D1E /* MWMTag+Convenience.h in Headers */,
|
||||
479F704F234FB60400011E2E /* MWMCatalogObserver.h in Headers */,
|
||||
47E8164023B2B98F008FD836 /* MWMUser.h in Headers */,
|
||||
47EEAFF72350D060005CF316 /* MWMCommon.h in Headers */,
|
||||
47D9019523AC22E500D9364C /* MWMMapUpdateInfo.h in Headers */,
|
||||
9957FADB237ACB1100855F48 /* DeepLinkSearchData.h in Headers */,
|
||||
|
@ -524,6 +539,7 @@
|
|||
479F7047234F774100011E2E /* MWMFrameworkHelper.mm in Sources */,
|
||||
470016072342541100EBF03D /* MWMTag.m in Sources */,
|
||||
47D9019623AC22E500D9364C /* MWMMapUpdateInfo.mm in Sources */,
|
||||
47E8164123B2B98F008FD836 /* MWMUser.mm in Sources */,
|
||||
471AB98E23AB925D00F56D49 /* MWMMapSearchResult.mm in Sources */,
|
||||
479834EA2342697400724D1E /* MWMTag+Convenience.mm in Sources */,
|
||||
47C637D62354AEBE00E12DE0 /* MWMTrafficManager.mm in Sources */,
|
||||
|
|
|
@ -19,6 +19,7 @@ FOUNDATION_EXPORT const unsigned char CoreApiVersionString[];
|
|||
#import <CoreApi/MWMTagGroup.h>
|
||||
#import <CoreApi/MWMTrafficManager.h>
|
||||
#import <CoreApi/MWMTypes.h>
|
||||
#import <CoreApi/MWMUser.h>
|
||||
#import <CoreApi/MWMUTM.h>
|
||||
#import <CoreApi/PromoDiscoveryCampaignAdapter.h>
|
||||
#import <CoreApi/PromoAfterBookingCampaignAdapter.h>
|
||||
|
|
|
@ -15,8 +15,10 @@ FOUNDATION_EXPORT const unsigned char CoreApiVersionString[];
|
|||
#import <CoreApi/MWMFrameworkHelper.h>
|
||||
#import <CoreApi/MWMNetworkPolicy.h>
|
||||
#import <CoreApi/MWMSearchFrameworkHelper.h>
|
||||
#import <CoreApi/MWMStorage.h>
|
||||
#import <CoreApi/MWMTag.h>
|
||||
#import <CoreApi/MWMTagGroup.h>
|
||||
#import <CoreApi/MWMTrafficManager.h>
|
||||
#import <CoreApi/MWMTypes.h>
|
||||
#import <CoreApi/MWMUser.h>
|
||||
#import <CoreApi/MWMUTM.h>
|
||||
|
|
|
@ -1,33 +1,36 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "MWMTypes.h"
|
||||
|
||||
typedef NS_ENUM(NSInteger, MWMSocialTokenType) {
|
||||
MWMSocialTokenTypeGoogle,
|
||||
MWMSocialTokenTypeFacebook,
|
||||
MWMSocialTokenTypePhone
|
||||
};
|
||||
} NS_SWIFT_NAME(SocialTokenType);
|
||||
|
||||
typedef NS_ENUM(NSInteger, MWMAuthorizationSource) {
|
||||
MWMAuthorizationSourceUGC,
|
||||
MWMAuthorizationSourceBookmarks
|
||||
};
|
||||
} NS_SWIFT_NAME(AuthorizationSource);
|
||||
|
||||
typedef NS_ENUM(NSInteger, MWMAuthorizationError) {
|
||||
MWMAuthorizationErrorCancelled,
|
||||
MWMAuthorizationErrorPassportError
|
||||
};
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef void (^MWMAuthorizationCompleteBlock)(BOOL);
|
||||
NS_SWIFT_NAME(User)
|
||||
@interface MWMUser : NSObject
|
||||
|
||||
@interface MWMAuthorizationViewModel : NSObject
|
||||
|
||||
+ (NSURL * _Nullable)phoneAuthURL;
|
||||
+ (nullable NSURL *)phoneAuthURL;
|
||||
+ (BOOL)isAuthenticated;
|
||||
+ (void)authenticateWithToken:(NSString * _Nonnull)token
|
||||
+ (NSString *)termsOfUseLink;
|
||||
+ (NSString *)privacyPolicyLink;
|
||||
|
||||
+ (void)authenticateWithToken:(NSString *)token
|
||||
type:(MWMSocialTokenType)type
|
||||
privacyAccepted:(BOOL)privacyAccepted
|
||||
termsAccepted:(BOOL)termsAccepted
|
||||
promoAccepted:(BOOL)promoAccepted
|
||||
source:(MWMAuthorizationSource)source
|
||||
onComplete:(MWMAuthorizationCompleteBlock _Nonnull)onComplete;
|
||||
+ (NSString * _Nonnull)termsOfUseLink;
|
||||
+ (NSString * _Nonnull)privacyPolicyLink;
|
||||
onComplete:(MWMBoolBlock)onComplete;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
55
iphone/CoreApi/CoreApi/User/MWMUser.mm
Normal file
55
iphone/CoreApi/CoreApi/User/MWMUser.mm
Normal file
|
@ -0,0 +1,55 @@
|
|||
#import "MWMUser.h"
|
||||
|
||||
#include <CoreApi/Framework.h>
|
||||
|
||||
@implementation MWMUser
|
||||
|
||||
+ (nullable NSURL *)phoneAuthURL {
|
||||
return [NSURL URLWithString:@(GetFramework().GetUser().GetPhoneAuthUrl("http://localhost").c_str())];
|
||||
}
|
||||
|
||||
+ (BOOL)isAuthenticated {
|
||||
return GetFramework().GetUser().IsAuthenticated();
|
||||
}
|
||||
|
||||
+ (NSString *)termsOfUseLink {
|
||||
return @(User::GetTermsOfUseLink().c_str());
|
||||
}
|
||||
|
||||
+ (NSString *)privacyPolicyLink {
|
||||
return @(User::GetPrivacyPolicyLink().c_str());
|
||||
}
|
||||
|
||||
+ (void)authenticateWithToken:(NSString *)token
|
||||
type:(MWMSocialTokenType)type
|
||||
privacyAccepted:(BOOL)privacyAccepted
|
||||
termsAccepted:(BOOL)termsAccepted
|
||||
promoAccepted:(BOOL)promoAccepted
|
||||
source:(MWMAuthorizationSource)source
|
||||
onComplete:(MWMBoolBlock)onComplete {
|
||||
auto &user = GetFramework().GetUser();
|
||||
User::SocialTokenType socialTokenType;
|
||||
NSString *provider = nil;
|
||||
switch (type) {
|
||||
case MWMSocialTokenTypeGoogle:
|
||||
socialTokenType = User::SocialTokenType::Google;
|
||||
break;
|
||||
case MWMSocialTokenTypeFacebook:
|
||||
socialTokenType = User::SocialTokenType::Facebook;
|
||||
break;
|
||||
case MWMSocialTokenTypePhone:
|
||||
socialTokenType = User::SocialTokenType::Phone;
|
||||
break;
|
||||
}
|
||||
auto s = std::make_unique<User::Subscriber>();
|
||||
s->m_postCallAction = User::Subscriber::Action::RemoveSubscriber;
|
||||
s->m_onAuthenticate = [provider, source, onComplete](bool success) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
onComplete(success);
|
||||
});
|
||||
};
|
||||
user.AddSubscriber(std::move(s));
|
||||
user.Authenticate(token.UTF8String, socialTokenType, privacyAccepted, termsAccepted, promoAccepted);
|
||||
}
|
||||
|
||||
@end
|
|
@ -228,13 +228,13 @@ class PaidRouteViewController: MWMViewController {
|
|||
}
|
||||
|
||||
@IBAction func onTerms(_ sender: UIButton) {
|
||||
guard let url = URL(string: MWMAuthorizationViewModel.termsOfUseLink()) else { return }
|
||||
guard let url = URL(string: User.termsOfUseLink()) else { return }
|
||||
let safari = SFSafariViewController(url: url)
|
||||
self.present(safari, animated: true, completion: nil)
|
||||
}
|
||||
|
||||
@IBAction func onPrivacy(_ sender: UIButton) {
|
||||
guard let url = URL(string: MWMAuthorizationViewModel.privacyPolicyLink()) else { return }
|
||||
guard let url = URL(string: User.privacyPolicyLink()) else { return }
|
||||
let safari = SFSafariViewController(url: url)
|
||||
self.present(safari, animated: true, completion: nil)
|
||||
}
|
||||
|
|
|
@ -123,13 +123,13 @@ class BaseSubscriptionViewController: MWMViewController {
|
|||
}
|
||||
|
||||
@IBAction func onTerms(_ sender: UIButton) {
|
||||
guard let url = URL(string: MWMAuthorizationViewModel.termsOfUseLink()) else { return }
|
||||
guard let url = URL(string: User.termsOfUseLink()) else { return }
|
||||
let safari = SFSafariViewController(url: url)
|
||||
self.present(safari, animated: true, completion: nil)
|
||||
}
|
||||
|
||||
@IBAction func onPrivacy(_ sender: UIButton) {
|
||||
guard let url = URL(string: MWMAuthorizationViewModel.privacyPolicyLink()) else { return }
|
||||
guard let url = URL(string: User.privacyPolicyLink()) else { return }
|
||||
let safari = SFSafariViewController(url: url)
|
||||
self.present(safari, animated: true, completion: nil)
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ final class BMCDefaultViewModel: NSObject {
|
|||
}
|
||||
|
||||
private func setPermissions() {
|
||||
isAuthenticated = MWMAuthorizationViewModel.isAuthenticated()
|
||||
isAuthenticated = User.isAuthenticated()
|
||||
if !isAuthenticated {
|
||||
Statistics.logEvent(kStatBookmarksSyncProposalShown, withParameters: [kStatHasAuthorization: 0])
|
||||
permissions = [.signup]
|
||||
|
|
|
@ -50,7 +50,7 @@ final class BookmarksSharingViewController: MWMTableViewController {
|
|||
@IBOutlet private weak var licenseAgreementTextView: UITextView! {
|
||||
didSet {
|
||||
let htmlString = String(coreFormat: L("ugc_routes_user_agreement"),
|
||||
arguments: [MWMAuthorizationViewModel.termsOfUseLink()])
|
||||
arguments: [User.termsOfUseLink()])
|
||||
let attributes: [NSAttributedString.Key : Any] = [NSAttributedString.Key.font: UIFont.regular14(),
|
||||
NSAttributedString.Key.foregroundColor: UIColor.blackSecondaryText()]
|
||||
licenseAgreementTextView.attributedText = NSAttributedString.string(withHtml: htmlString,
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#import "MapViewController.h"
|
||||
#import "MWMActivityViewController.h"
|
||||
#import "MWMAlertViewController.h"
|
||||
#import "MWMAuthorizationViewModel.h"
|
||||
#import "MWMAvailableAreaAffectDirection.h"
|
||||
#import "MWMBanner.h"
|
||||
#import "MWMBottomMenuViewController.h"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
extension UIViewController {
|
||||
@objc func signup(anchor: UIView, onComplete: @escaping (Bool) -> Void) {
|
||||
if MWMAuthorizationViewModel.isAuthenticated() {
|
||||
if User.isAuthenticated() {
|
||||
onComplete(true)
|
||||
} else {
|
||||
let authVC = AuthorizationViewController(popoverSourceView: anchor,
|
||||
|
|
|
@ -70,7 +70,6 @@
|
|||
3406FA191C6E0D8F00E9FAD2 /* MWMMapDownloadDialog.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3406FA171C6E0D8F00E9FAD2 /* MWMMapDownloadDialog.xib */; };
|
||||
340708651F2905A500029ECC /* NavigationInfoArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = 340708631F2905A500029ECC /* NavigationInfoArea.swift */; };
|
||||
340708781F2B5D6C00029ECC /* DimBackground.swift in Sources */ = {isa = PBXBuildFile; fileRef = 340708761F2B5D6C00029ECC /* DimBackground.swift */; };
|
||||
3408963F1F83CEDE00BC7117 /* MWMAuthorizationViewModel.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3408963D1F83CEDE00BC7117 /* MWMAuthorizationViewModel.mm */; };
|
||||
3409D50B1FC6D8D2000F9B3E /* FilterCheckCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3409D5091FC6D8D2000F9B3E /* FilterCheckCell.swift */; };
|
||||
340B33C61F3AEFDB00A8C1B4 /* MWMRouter+RouteManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 340B33C41F3AEFDB00A8C1B4 /* MWMRouter+RouteManager.mm */; };
|
||||
340E1EEC1E2F614400CE49BF /* Authorization.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 340E1EE41E2F614400CE49BF /* Authorization.storyboard */; };
|
||||
|
@ -972,8 +971,6 @@
|
|||
340837121B7243CE00B5C185 /* MWMActivityViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMActivityViewController.mm; sourceTree = "<group>"; };
|
||||
340837141B72451A00B5C185 /* MWMShareActivityItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMShareActivityItem.h; sourceTree = "<group>"; };
|
||||
340837151B72451A00B5C185 /* MWMShareActivityItem.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMShareActivityItem.mm; sourceTree = "<group>"; };
|
||||
3408963C1F83CEDE00BC7117 /* MWMAuthorizationViewModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMAuthorizationViewModel.h; sourceTree = "<group>"; };
|
||||
3408963D1F83CEDE00BC7117 /* MWMAuthorizationViewModel.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMAuthorizationViewModel.mm; sourceTree = "<group>"; };
|
||||
3409D5091FC6D8D2000F9B3E /* FilterCheckCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilterCheckCell.swift; sourceTree = "<group>"; };
|
||||
340B33C41F3AEFDB00A8C1B4 /* MWMRouter+RouteManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "MWMRouter+RouteManager.mm"; sourceTree = "<group>"; };
|
||||
340DC82B1C4E72C700EAA2CC /* liboauthcpp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liboauthcpp.a; path = "../../../omim-xcode-build/Debug/liboauthcpp.a"; sourceTree = "<group>"; };
|
||||
|
@ -3277,8 +3274,6 @@
|
|||
34BBD6561F826F810070CA50 /* AuthorizationTransitioningManager.swift */,
|
||||
34BBD64A1F826DB10070CA50 /* AuthorizationViewController.swift */,
|
||||
34BBD6661F8273350070CA50 /* AuthorizationViewController.xib */,
|
||||
3408963C1F83CEDE00BC7117 /* MWMAuthorizationViewModel.h */,
|
||||
3408963D1F83CEDE00BC7117 /* MWMAuthorizationViewModel.mm */,
|
||||
47FA14D0230D52FC003DA979 /* PhoneNumberAuthorizationViewController.swift */,
|
||||
);
|
||||
path = Authorization;
|
||||
|
@ -5312,7 +5307,6 @@
|
|||
47F86D0120C93D8D00FEE291 /* TabViewController.swift in Sources */,
|
||||
99536113235DB86C008B218F /* BookmarksSubscriptionDiscountLabel.swift in Sources */,
|
||||
6741A9A51BF340DE002C974C /* MWMShareActivityItem.mm in Sources */,
|
||||
3408963F1F83CEDE00BC7117 /* MWMAuthorizationViewModel.mm in Sources */,
|
||||
F6E2FE1F1E097BA00083EBEC /* MWMOpeningHoursCommon.mm in Sources */,
|
||||
3454D7B91E07F045004AF2AD /* CALayer+RuntimeAttributes.m in Sources */,
|
||||
99E2B0232369904800FFABC5 /* WelcomeViewController.swift in Sources */,
|
||||
|
|
|
@ -169,13 +169,13 @@ import SafariServices
|
|||
}
|
||||
|
||||
@IBAction func onTerms(_ sender: UIButton) {
|
||||
guard let url = URL(string: MWMAuthorizationViewModel.termsOfUseLink()) else { return }
|
||||
guard let url = URL(string: User.termsOfUseLink()) else { return }
|
||||
let safari = SFSafariViewController(url: url)
|
||||
self.present(safari, animated: true, completion: nil)
|
||||
}
|
||||
|
||||
@IBAction func onPrivacy(_ sender: UIButton) {
|
||||
guard let url = URL(string: MWMAuthorizationViewModel.privacyPolicyLink()) else { return }
|
||||
guard let url = URL(string: User.privacyPolicyLink()) else { return }
|
||||
let safari = SFSafariViewController(url: url)
|
||||
self.present(safari, animated: true, completion: nil)
|
||||
}
|
||||
|
|
|
@ -3,9 +3,13 @@ import FBSDKLoginKit
|
|||
import GoogleSignIn
|
||||
import SafariServices
|
||||
|
||||
@objc enum AuthorizationError: Int {
|
||||
case cancelled
|
||||
case passportError
|
||||
}
|
||||
|
||||
@objc(MWMAuthorizationViewController)
|
||||
final class AuthorizationViewController: MWMViewController {
|
||||
typealias ViewModel = MWMAuthorizationViewModel
|
||||
|
||||
private let transitioningManager: AuthorizationTransitioningManager
|
||||
|
||||
|
@ -152,7 +156,7 @@ final class AuthorizationViewController: MWMViewController {
|
|||
|
||||
@IBOutlet private weak var privacyPolicyTextView: UITextView! {
|
||||
didSet {
|
||||
let htmlString = String(coreFormat: L("sign_agree_pp_gdpr"), arguments: [ViewModel.privacyPolicyLink()])
|
||||
let htmlString = String(coreFormat: L("sign_agree_pp_gdpr"), arguments: [User.privacyPolicyLink()])
|
||||
let attributes: [NSAttributedString.Key : Any] = [NSAttributedString.Key.font: UIFont.regular16(),
|
||||
NSAttributedString.Key.foregroundColor: UIColor.blackPrimaryText()]
|
||||
privacyPolicyTextView.attributedText = NSAttributedString.string(withHtml: htmlString,
|
||||
|
@ -163,7 +167,7 @@ final class AuthorizationViewController: MWMViewController {
|
|||
|
||||
@IBOutlet private weak var termsOfUseTextView: UITextView! {
|
||||
didSet {
|
||||
let htmlString = String(coreFormat: L("sign_agree_tof_gdpr"), arguments: [ViewModel.termsOfUseLink()])
|
||||
let htmlString = String(coreFormat: L("sign_agree_tof_gdpr"), arguments: [User.termsOfUseLink()])
|
||||
let attributes: [NSAttributedString.Key : Any] = [NSAttributedString.Key.font: UIFont.regular16(),
|
||||
NSAttributedString.Key.foregroundColor: UIColor.blackPrimaryText()]
|
||||
termsOfUseTextView.attributedText = NSAttributedString.string(withHtml: htmlString,
|
||||
|
@ -183,17 +187,17 @@ final class AuthorizationViewController: MWMViewController {
|
|||
|
||||
@IBOutlet private weak var topToContentConstraint: NSLayoutConstraint!
|
||||
|
||||
typealias SuccessHandler = (MWMSocialTokenType) -> Void
|
||||
typealias ErrorHandler = (MWMAuthorizationError) -> Void
|
||||
typealias SuccessHandler = (SocialTokenType) -> Void
|
||||
typealias ErrorHandler = (AuthorizationError) -> Void
|
||||
typealias CompletionHandler = (AuthorizationViewController) -> Void
|
||||
|
||||
private let sourceComponent: MWMAuthorizationSource
|
||||
private let sourceComponent: AuthorizationSource
|
||||
private let successHandler: SuccessHandler?
|
||||
private let errorHandler: ErrorHandler?
|
||||
private let completionHandler: CompletionHandler?
|
||||
|
||||
@objc
|
||||
init(barButtonItem: UIBarButtonItem?, sourceComponent: MWMAuthorizationSource, successHandler: SuccessHandler? = nil, errorHandler: ErrorHandler? = nil, completionHandler: CompletionHandler? = nil) {
|
||||
init(barButtonItem: UIBarButtonItem?, sourceComponent: AuthorizationSource, successHandler: SuccessHandler? = nil, errorHandler: ErrorHandler? = nil, completionHandler: CompletionHandler? = nil) {
|
||||
self.sourceComponent = sourceComponent
|
||||
self.successHandler = successHandler
|
||||
self.errorHandler = errorHandler
|
||||
|
@ -205,7 +209,7 @@ final class AuthorizationViewController: MWMViewController {
|
|||
}
|
||||
|
||||
@objc
|
||||
init(popoverSourceView: UIView? = nil, sourceComponent: MWMAuthorizationSource, permittedArrowDirections: UIPopoverArrowDirection = .unknown, successHandler: SuccessHandler? = nil, errorHandler: ErrorHandler? = nil, completionHandler: CompletionHandler? = nil) {
|
||||
init(popoverSourceView: UIView? = nil, sourceComponent: AuthorizationSource, permittedArrowDirections: UIPopoverArrowDirection = .unknown, successHandler: SuccessHandler? = nil, errorHandler: ErrorHandler? = nil, completionHandler: CompletionHandler? = nil) {
|
||||
self.sourceComponent = sourceComponent
|
||||
self.successHandler = successHandler
|
||||
self.errorHandler = errorHandler
|
||||
|
@ -249,15 +253,17 @@ final class AuthorizationViewController: MWMViewController {
|
|||
completionHandler?(self)
|
||||
}
|
||||
|
||||
private func getProviderStatStr(type: MWMSocialTokenType) -> String {
|
||||
private func getProviderStatStr(type: SocialTokenType) -> String {
|
||||
switch type {
|
||||
case .facebook: return kStatFacebook
|
||||
case .google: return kStatGoogle
|
||||
case .phone: return kStatPhone
|
||||
@unknown default:
|
||||
fatalError()
|
||||
}
|
||||
}
|
||||
|
||||
private func process(error: Error, type: MWMSocialTokenType) {
|
||||
private func process(error: Error, type: SocialTokenType) {
|
||||
Statistics.logEvent(kStatUGCReviewAuthError, withParameters: [
|
||||
kStatProvider: getProviderStatStr(type: type),
|
||||
kStatError: error.localizedDescription,
|
||||
|
@ -266,22 +272,54 @@ final class AuthorizationViewController: MWMViewController {
|
|||
Crashlytics.sharedInstance().recordError(error)
|
||||
}
|
||||
|
||||
private func process(token: String, type: MWMSocialTokenType) {
|
||||
Statistics.logEvent(kStatUGCReviewAuthExternalRequestSuccess, withParameters: [kStatProvider: getProviderStatStr(type: type)])
|
||||
ViewModel.authenticate(withToken: token,
|
||||
type: type,
|
||||
privacyAccepted: privacyPolicyCheck.isChecked,
|
||||
termsAccepted: termsOfUseCheck.isChecked,
|
||||
promoAccepted: latestNewsCheck.isChecked,
|
||||
source: sourceComponent) { success in
|
||||
if success {
|
||||
self.successHandler?(type)
|
||||
} else {
|
||||
self.errorHandler?(.passportError)
|
||||
}
|
||||
private func process(token: String, type: SocialTokenType) {
|
||||
Statistics.logEvent(kStatUGCReviewAuthExternalRequestSuccess,
|
||||
withParameters: [kStatProvider: getProviderStatStr(type: type)])
|
||||
User.authenticate(withToken: token,
|
||||
type: type,
|
||||
privacyAccepted: privacyPolicyCheck.isChecked,
|
||||
termsAccepted: termsOfUseCheck.isChecked,
|
||||
promoAccepted: latestNewsCheck.isChecked,
|
||||
source: sourceComponent) { success in
|
||||
self.logStats(type: type, success: success)
|
||||
if success {
|
||||
self.successHandler?(type)
|
||||
} else {
|
||||
self.errorHandler?(.passportError)
|
||||
}
|
||||
}
|
||||
onClose()
|
||||
}
|
||||
|
||||
private func logStats(type: SocialTokenType, success: Bool) {
|
||||
let provider: String
|
||||
switch type {
|
||||
case .google:
|
||||
provider = kStatGoogle
|
||||
case .facebook:
|
||||
provider = kStatFacebook
|
||||
case .phone:
|
||||
provider = kStatPhone
|
||||
@unknown default:
|
||||
fatalError()
|
||||
}
|
||||
|
||||
let event: String?
|
||||
switch self.sourceComponent {
|
||||
case .UGC:
|
||||
event = success ? kStatUGCReviewAuthRequestSuccess : kStatUGCReviewAuthError
|
||||
case .bookmarks:
|
||||
event = success ? kStatBookmarksAuthRequestSuccess : kStatBookmarksAuthRequestError
|
||||
@unknown default:
|
||||
fatalError()
|
||||
}
|
||||
|
||||
if success {
|
||||
Statistics.logEvent(event, withParameters: [kStatProvider : provider])
|
||||
} else {
|
||||
Statistics.logEvent(event, withParameters: [kStatProvider : provider, kStatError : ""])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension AuthorizationViewController: GIDSignInUIDelegate {
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15510"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
|
@ -42,7 +40,7 @@
|
|||
</connections>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="mb9-vK-FLE">
|
||||
<rect key="frame" x="0.0" y="212.5" width="375" height="454.5"/>
|
||||
<rect key="frame" x="0.0" y="174" width="375" height="493"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Sign in with social" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LFT-Lb-6jj">
|
||||
<rect key="frame" x="16" y="10" width="343" height="24"/>
|
||||
|
@ -58,218 +56,212 @@
|
|||
</constraints>
|
||||
</view>
|
||||
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" verticalHuggingPriority="750" verticalCompressionResistancePriority="250" bounces="NO" bouncesZoom="NO" translatesAutoresizingMaskIntoConstraints="NO" id="C1g-0v-suZ">
|
||||
<rect key="frame" x="0.0" y="45" width="375" height="409.5"/>
|
||||
<rect key="frame" x="0.0" y="45" width="375" height="448"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="eSu-cK-AZG">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="409.5"/>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="H2u-Ej-d0V">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="448"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Cdf-p5-Bbb">
|
||||
<rect key="frame" x="32" y="59" width="311" height="55.5"/>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="AlH-L6-B76">
|
||||
<rect key="frame" x="16" y="16" width="343" height="416"/>
|
||||
<subviews>
|
||||
<view opaque="NO" contentMode="center" translatesAutoresizingMaskIntoConstraints="NO" id="33D-0u-y3N" customClass="Checkmark" customModule="maps_me" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="40" height="55.5"/>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="To continue you must accept our Terms of Use and Privacy Policy. Please read them carefully. " lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0EA-1u-hvB">
|
||||
<rect key="frame" x="0.0" y="0.0" width="343" height="33.5"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<color key="textColor" white="0.0" alpha="0.5428312059859155" colorSpace="calibratedWhite"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Cdf-p5-Bbb">
|
||||
<rect key="frame" x="0.0" y="49.5" width="343" height="50"/>
|
||||
<subviews>
|
||||
<view opaque="NO" contentMode="center" translatesAutoresizingMaskIntoConstraints="NO" id="33D-0u-y3N" customClass="Checkmark" customModule="maps_me" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="5" width="40" height="40"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="40" id="awT-NV-5En"/>
|
||||
<constraint firstAttribute="height" priority="750" constant="40" id="wCl-1O-rWh"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="image" keyPath="offImage" value="radioBtnOff"/>
|
||||
<userDefinedRuntimeAttribute type="image" keyPath="onImage" value="radioBtnOn"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<action selector="onCheck:" destination="-1" eventType="valueChanged" id="GHm-Xj-Fic"/>
|
||||
</connections>
|
||||
</view>
|
||||
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" scrollEnabled="NO" editable="NO" text="I agree to Privacy Policy" translatesAutoresizingMaskIntoConstraints="NO" id="LhW-gs-XN9" customClass="LinkTextView" customModule="maps_me" customModuleProvider="target">
|
||||
<rect key="frame" x="40" y="0.0" width="182.5" height="50"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<fontDescription key="fontDescription" name=".AppleSystemUIFont" family=".AppleSystemUIFont" pointSize="16"/>
|
||||
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="textContainer.lineFragmentPadding">
|
||||
<integer key="value" value="0"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="rect" keyPath="textContainerInset">
|
||||
<rect key="value" x="0.0" y="0.0" width="0.0" height="0.0"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="-1" id="JGn-dX-5rs"/>
|
||||
</connections>
|
||||
</textView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="40" id="awT-NV-5En"/>
|
||||
<constraint firstItem="33D-0u-y3N" firstAttribute="centerY" secondItem="Cdf-p5-Bbb" secondAttribute="centerY" id="Hpf-Bd-pr2"/>
|
||||
<constraint firstItem="33D-0u-y3N" firstAttribute="leading" secondItem="Cdf-p5-Bbb" secondAttribute="leading" id="bfU-g4-jey"/>
|
||||
<constraint firstItem="LhW-gs-XN9" firstAttribute="centerY" secondItem="Cdf-p5-Bbb" secondAttribute="centerY" id="gIq-kr-jZg"/>
|
||||
<constraint firstItem="LhW-gs-XN9" firstAttribute="top" secondItem="Cdf-p5-Bbb" secondAttribute="top" id="mhL-Bd-ArP"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="LhW-gs-XN9" secondAttribute="trailing" constant="8" id="v1T-SO-6ll"/>
|
||||
<constraint firstAttribute="bottom" secondItem="LhW-gs-XN9" secondAttribute="bottom" id="xgl-tw-klI"/>
|
||||
<constraint firstItem="LhW-gs-XN9" firstAttribute="leading" secondItem="33D-0u-y3N" secondAttribute="trailing" id="yOg-UF-SwU"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="XHd-bd-GsP">
|
||||
<rect key="frame" x="0.0" y="115.5" width="343" height="50"/>
|
||||
<subviews>
|
||||
<view opaque="NO" contentMode="center" translatesAutoresizingMaskIntoConstraints="NO" id="3cN-Qb-mdM" customClass="Checkmark" customModule="maps_me" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="5" width="40" height="40"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="40" id="Gsk-Bp-DHv"/>
|
||||
<constraint firstAttribute="height" priority="750" constant="40" id="SoD-Xr-JE3"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="image" keyPath="offImage" value="radioBtnOff"/>
|
||||
<userDefinedRuntimeAttribute type="image" keyPath="onImage" value="radioBtnOn"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<action selector="onCheck:" destination="-1" eventType="valueChanged" id="3jl-dT-yZS"/>
|
||||
</connections>
|
||||
</view>
|
||||
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" editable="NO" text="I agree to Terms of Use" translatesAutoresizingMaskIntoConstraints="NO" id="PBR-9l-2Gh" customClass="LinkTextView" customModule="maps_me" customModuleProvider="target">
|
||||
<rect key="frame" x="40" y="0.0" width="178.5" height="50"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<fontDescription key="fontDescription" name=".AppleSystemUIFont" family=".AppleSystemUIFont" pointSize="16"/>
|
||||
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="textContainer.lineFragmentPadding">
|
||||
<integer key="value" value="0"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="rect" keyPath="textContainerInset">
|
||||
<rect key="value" x="0.0" y="0.0" width="0.0" height="0.0"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</textView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="PBR-9l-2Gh" secondAttribute="bottom" id="0VT-4u-6Fg"/>
|
||||
<constraint firstItem="PBR-9l-2Gh" firstAttribute="top" secondItem="XHd-bd-GsP" secondAttribute="top" id="9eq-98-ygD"/>
|
||||
<constraint firstItem="PBR-9l-2Gh" firstAttribute="leading" secondItem="3cN-Qb-mdM" secondAttribute="trailing" id="IfC-hN-RRh"/>
|
||||
<constraint firstItem="3cN-Qb-mdM" firstAttribute="leading" secondItem="XHd-bd-GsP" secondAttribute="leading" id="Z3C-FT-yqQ"/>
|
||||
<constraint firstItem="PBR-9l-2Gh" firstAttribute="centerY" secondItem="XHd-bd-GsP" secondAttribute="centerY" id="ZBA-dD-J65"/>
|
||||
<constraint firstItem="3cN-Qb-mdM" firstAttribute="centerY" secondItem="XHd-bd-GsP" secondAttribute="centerY" id="mzV-Yb-IS8"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="PBR-9l-2Gh" secondAttribute="trailing" constant="8" id="x3t-yD-KpE"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4NF-GO-a8Q">
|
||||
<rect key="frame" x="0.0" y="181.5" width="343" height="54.5"/>
|
||||
<subviews>
|
||||
<view opaque="NO" contentMode="center" translatesAutoresizingMaskIntoConstraints="NO" id="Z2X-Qq-dwV" customClass="Checkmark" customModule="maps_me" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="7.5" width="40" height="40"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="40" id="Ed8-DA-DiE"/>
|
||||
<constraint firstAttribute="height" priority="750" constant="40" id="idl-uC-ZJK"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="image" keyPath="offImage" value="radioBtnOff"/>
|
||||
<userDefinedRuntimeAttribute type="image" keyPath="onImage" value="radioBtnOn"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" editable="NO" text="I agree to recieve the latest news about MAPS.ME products" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="p04-D7-97V">
|
||||
<rect key="frame" x="40" y="0.0" width="295" height="54.5"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<fontDescription key="fontDescription" name=".AppleSystemUIFont" family=".AppleSystemUIFont" pointSize="16"/>
|
||||
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="textContainer.lineFragmentPadding">
|
||||
<integer key="value" value="0"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="rect" keyPath="textContainerInset">
|
||||
<rect key="value" x="0.0" y="0.0" width="0.0" height="0.0"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</textView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="p04-D7-97V" firstAttribute="top" secondItem="4NF-GO-a8Q" secondAttribute="top" id="7DY-f4-uiW"/>
|
||||
<constraint firstAttribute="bottom" secondItem="p04-D7-97V" secondAttribute="bottom" id="At3-DG-uub"/>
|
||||
<constraint firstItem="p04-D7-97V" firstAttribute="centerY" secondItem="4NF-GO-a8Q" secondAttribute="centerY" id="DmF-eC-tLg"/>
|
||||
<constraint firstItem="Z2X-Qq-dwV" firstAttribute="centerY" secondItem="4NF-GO-a8Q" secondAttribute="centerY" id="Eza-bU-j9x"/>
|
||||
<constraint firstItem="Z2X-Qq-dwV" firstAttribute="leading" secondItem="4NF-GO-a8Q" secondAttribute="leading" id="gTk-JI-cfK"/>
|
||||
<constraint firstItem="p04-D7-97V" firstAttribute="leading" secondItem="Z2X-Qq-dwV" secondAttribute="trailing" id="jda-uN-kLq"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="p04-D7-97V" secondAttribute="trailing" constant="8" id="u9Y-IJ-lA3"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8iU-Se-s8N" customClass="LeftAlignedIconButton" customModule="maps_me" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="252" width="343" height="44"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="44" id="GEc-UM-DNb"/>
|
||||
</constraints>
|
||||
<inset key="imageEdgeInsets" minX="16" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
<state key="normal" title="Google" image="login_google_button"/>
|
||||
<connections>
|
||||
<action selector="googleSignIn" destination="-1" eventType="touchUpInside" id="pit-ir-2fB"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="O8A-fR-loh" customClass="LeftAlignedIconButton" customModule="maps_me" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="312" width="343" height="44"/>
|
||||
<color key="backgroundColor" red="0.23137254901960785" green="0.34901960784313724" blue="0.59607843137254901" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="44" id="Evn-BD-u7u"/>
|
||||
</constraints>
|
||||
<inset key="imageEdgeInsets" minX="16" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
<state key="normal" title="Facebook" image="login_facebook_button"/>
|
||||
<connections>
|
||||
<action selector="facebookSignIn" destination="-1" eventType="touchUpInside" id="t2x-dC-1bh"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZDx-fj-xoO">
|
||||
<rect key="frame" x="0.0" y="372" width="343" height="44"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="44" id="jEe-rd-j73"/>
|
||||
</constraints>
|
||||
<state key="normal" title="Phone number"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="image" keyPath="offImage" value="radioBtnOff"/>
|
||||
<userDefinedRuntimeAttribute type="image" keyPath="onImage" value="radioBtnOn"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="fontName" value="bold14"/>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="8"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="localizedText" value="phone_number"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="backgroundColorName" value="linkBlue"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="textColorHighlightedName" value="whitePrimaryTextHighlighted"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="textColorName" value="whitePrimaryText"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<action selector="onCheck:" destination="-1" eventType="valueChanged" id="GHm-Xj-Fic"/>
|
||||
<action selector="phoneSignIn" destination="-1" eventType="touchUpInside" id="EmS-LY-4qT"/>
|
||||
</connections>
|
||||
</view>
|
||||
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" editable="NO" text="I agree to Privacy Policy" translatesAutoresizingMaskIntoConstraints="NO" id="LhW-gs-XN9" customClass="LinkTextView" customModule="maps_me" customModuleProvider="target">
|
||||
<rect key="frame" x="40" y="10" width="182.5" height="35.5"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<fontDescription key="fontDescription" name=".AppleSystemUIFont" family=".AppleSystemUIFont" pointSize="16"/>
|
||||
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="textContainer.lineFragmentPadding">
|
||||
<integer key="value" value="0"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="rect" keyPath="textContainerInset">
|
||||
<rect key="value" x="0.0" y="0.0" width="0.0" height="0.0"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="-1" id="JGn-dX-5rs"/>
|
||||
</connections>
|
||||
</textView>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="33D-0u-y3N" firstAttribute="leading" secondItem="Cdf-p5-Bbb" secondAttribute="leading" id="bfU-g4-jey"/>
|
||||
<constraint firstItem="33D-0u-y3N" firstAttribute="top" secondItem="Cdf-p5-Bbb" secondAttribute="top" id="cE0-Vo-mlj"/>
|
||||
<constraint firstAttribute="bottom" secondItem="33D-0u-y3N" secondAttribute="bottom" id="gmp-bg-gGj"/>
|
||||
<constraint firstItem="LhW-gs-XN9" firstAttribute="top" secondItem="Cdf-p5-Bbb" secondAttribute="top" constant="10" id="mhL-Bd-ArP"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="LhW-gs-XN9" secondAttribute="trailing" constant="8" id="v1T-SO-6ll"/>
|
||||
<constraint firstAttribute="bottom" secondItem="LhW-gs-XN9" secondAttribute="bottom" constant="10" id="xgl-tw-klI"/>
|
||||
<constraint firstItem="LhW-gs-XN9" firstAttribute="leading" secondItem="33D-0u-y3N" secondAttribute="trailing" id="yOg-UF-SwU"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="XHd-bd-GsP">
|
||||
<rect key="frame" x="32" y="114.5" width="311" height="55.5"/>
|
||||
<subviews>
|
||||
<view opaque="NO" contentMode="center" translatesAutoresizingMaskIntoConstraints="NO" id="3cN-Qb-mdM" customClass="Checkmark" customModule="maps_me" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="40" height="55.5"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="40" id="Gsk-Bp-DHv"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="image" keyPath="offImage" value="radioBtnOff"/>
|
||||
<userDefinedRuntimeAttribute type="image" keyPath="onImage" value="radioBtnOn"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<action selector="onCheck:" destination="-1" eventType="valueChanged" id="3jl-dT-yZS"/>
|
||||
</connections>
|
||||
</view>
|
||||
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" editable="NO" text="I agree to Terms of Use" translatesAutoresizingMaskIntoConstraints="NO" id="PBR-9l-2Gh" customClass="LinkTextView" customModule="maps_me" customModuleProvider="target">
|
||||
<rect key="frame" x="40" y="10" width="178.5" height="35.5"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<fontDescription key="fontDescription" name=".AppleSystemUIFont" family=".AppleSystemUIFont" pointSize="16"/>
|
||||
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="textContainer.lineFragmentPadding">
|
||||
<integer key="value" value="0"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="rect" keyPath="textContainerInset">
|
||||
<rect key="value" x="0.0" y="0.0" width="0.0" height="0.0"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</textView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="PBR-9l-2Gh" secondAttribute="bottom" constant="10" id="0VT-4u-6Fg"/>
|
||||
<constraint firstItem="PBR-9l-2Gh" firstAttribute="top" secondItem="XHd-bd-GsP" secondAttribute="top" constant="10" id="9eq-98-ygD"/>
|
||||
<constraint firstItem="PBR-9l-2Gh" firstAttribute="leading" secondItem="3cN-Qb-mdM" secondAttribute="trailing" id="IfC-hN-RRh"/>
|
||||
<constraint firstItem="3cN-Qb-mdM" firstAttribute="leading" secondItem="XHd-bd-GsP" secondAttribute="leading" id="Z3C-FT-yqQ"/>
|
||||
<constraint firstItem="3cN-Qb-mdM" firstAttribute="top" secondItem="XHd-bd-GsP" secondAttribute="top" id="dkg-sP-6gL"/>
|
||||
<constraint firstAttribute="bottom" secondItem="3cN-Qb-mdM" secondAttribute="bottom" id="pRC-nx-yBP"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="PBR-9l-2Gh" secondAttribute="trailing" constant="8" id="x3t-yD-KpE"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4NF-GO-a8Q">
|
||||
<rect key="frame" x="32" y="170" width="311" height="55.5"/>
|
||||
<subviews>
|
||||
<view opaque="NO" contentMode="center" translatesAutoresizingMaskIntoConstraints="NO" id="Z2X-Qq-dwV" customClass="Checkmark" customModule="maps_me" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="40" height="55.5"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="40" id="Ed8-DA-DiE"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="image" keyPath="offImage" value="radioBtnOff"/>
|
||||
<userDefinedRuntimeAttribute type="image" keyPath="onImage" value="radioBtnOn"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" editable="NO" text="I agree to recieve latest news about our products" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="p04-D7-97V">
|
||||
<rect key="frame" x="40" y="10" width="263" height="35.5"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<fontDescription key="fontDescription" name=".AppleSystemUIFont" family=".AppleSystemUIFont" pointSize="16"/>
|
||||
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="textContainer.lineFragmentPadding">
|
||||
<integer key="value" value="0"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="rect" keyPath="textContainerInset">
|
||||
<rect key="value" x="0.0" y="0.0" width="0.0" height="0.0"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</textView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="p04-D7-97V" firstAttribute="top" secondItem="4NF-GO-a8Q" secondAttribute="top" constant="10" id="7DY-f4-uiW"/>
|
||||
<constraint firstAttribute="bottom" secondItem="p04-D7-97V" secondAttribute="bottom" constant="10" id="At3-DG-uub"/>
|
||||
<constraint firstAttribute="bottom" secondItem="Z2X-Qq-dwV" secondAttribute="bottom" id="HMC-MX-Gom"/>
|
||||
<constraint firstItem="Z2X-Qq-dwV" firstAttribute="top" secondItem="4NF-GO-a8Q" secondAttribute="top" id="d3x-dj-I9Q"/>
|
||||
<constraint firstItem="Z2X-Qq-dwV" firstAttribute="leading" secondItem="4NF-GO-a8Q" secondAttribute="leading" id="gTk-JI-cfK"/>
|
||||
<constraint firstItem="p04-D7-97V" firstAttribute="leading" secondItem="Z2X-Qq-dwV" secondAttribute="trailing" id="jda-uN-kLq"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="p04-D7-97V" secondAttribute="trailing" constant="8" id="u9Y-IJ-lA3"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8iU-Se-s8N" customClass="LeftAlignedIconButton" customModule="maps_me" customModuleProvider="target">
|
||||
<rect key="frame" x="32" y="237.5" width="311" height="40"/>
|
||||
<inset key="imageEdgeInsets" minX="16" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
<state key="normal" title="Google" image="login_google_button"/>
|
||||
<connections>
|
||||
<action selector="googleSignIn" destination="-1" eventType="touchUpInside" id="pit-ir-2fB"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="O8A-fR-loh" customClass="LeftAlignedIconButton" customModule="maps_me" customModuleProvider="target">
|
||||
<rect key="frame" x="32" y="293.5" width="311" height="40"/>
|
||||
<color key="backgroundColor" red="0.23137254901960785" green="0.34901960784313724" blue="0.59607843137254901" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<inset key="imageEdgeInsets" minX="16" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
<state key="normal" title="Facebook" image="login_facebook_button"/>
|
||||
<connections>
|
||||
<action selector="facebookSignIn" destination="-1" eventType="touchUpInside" id="t2x-dC-1bh"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZDx-fj-xoO">
|
||||
<rect key="frame" x="32" y="349.5" width="311" height="40"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="40" id="jEe-rd-j73"/>
|
||||
</constraints>
|
||||
<state key="normal" title="Phone number"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="fontName" value="bold14"/>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="8"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="localizedText" value="phone_number"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="backgroundColorName" value="linkBlue"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="textColorHighlightedName" value="whitePrimaryTextHighlighted"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="textColorName" value="whitePrimaryText"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<action selector="phoneSignIn" destination="-1" eventType="touchUpInside" id="EmS-LY-4qT"/>
|
||||
</connections>
|
||||
</button>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="To continue you must accept our Terms of Use and Privacy Policy. Please read them carefully. " lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0EA-1u-hvB">
|
||||
<rect key="frame" x="32" y="20" width="311" height="33.5"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<color key="textColor" white="0.0" alpha="0.5428312059859155" colorSpace="calibratedWhite"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</stackView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="0EA-1u-hvB" firstAttribute="trailing" secondItem="Cdf-p5-Bbb" secondAttribute="trailing" id="0aL-94-2S0"/>
|
||||
<constraint firstItem="4NF-GO-a8Q" firstAttribute="trailing" secondItem="8iU-Se-s8N" secondAttribute="trailing" id="6RS-e0-gTP"/>
|
||||
<constraint firstItem="4NF-GO-a8Q" firstAttribute="top" secondItem="XHd-bd-GsP" secondAttribute="bottom" id="7qp-Nm-K8G"/>
|
||||
<constraint firstItem="O8A-fR-loh" firstAttribute="top" secondItem="8iU-Se-s8N" secondAttribute="bottom" constant="16" id="8A3-dV-XD9"/>
|
||||
<constraint firstItem="8iU-Se-s8N" firstAttribute="top" secondItem="4NF-GO-a8Q" secondAttribute="bottom" constant="12" id="9km-qR-9Pg"/>
|
||||
<constraint firstItem="0EA-1u-hvB" firstAttribute="top" secondItem="eSu-cK-AZG" secondAttribute="top" constant="20" id="CEY-Fc-Ke1"/>
|
||||
<constraint firstItem="0EA-1u-hvB" firstAttribute="leading" secondItem="Cdf-p5-Bbb" secondAttribute="leading" id="T8k-DU-XSa"/>
|
||||
<constraint firstItem="O8A-fR-loh" firstAttribute="height" secondItem="8iU-Se-s8N" secondAttribute="height" id="UPb-aR-4iP"/>
|
||||
<constraint firstAttribute="bottom" secondItem="ZDx-fj-xoO" secondAttribute="bottom" constant="20" id="WBD-ik-SuA"/>
|
||||
<constraint firstItem="Cdf-p5-Bbb" firstAttribute="trailing" secondItem="XHd-bd-GsP" secondAttribute="trailing" id="YXt-XZ-b1M"/>
|
||||
<constraint firstItem="ZDx-fj-xoO" firstAttribute="trailing" secondItem="O8A-fR-loh" secondAttribute="trailing" id="bmQ-cr-oBt"/>
|
||||
<constraint firstItem="ZDx-fj-xoO" firstAttribute="height" secondItem="O8A-fR-loh" secondAttribute="height" id="bxT-8Q-tvg"/>
|
||||
<constraint firstItem="XHd-bd-GsP" firstAttribute="top" secondItem="Cdf-p5-Bbb" secondAttribute="bottom" id="cdP-NT-aSw"/>
|
||||
<constraint firstItem="ZDx-fj-xoO" firstAttribute="leading" secondItem="O8A-fR-loh" secondAttribute="leading" id="eSk-pZ-QJo"/>
|
||||
<constraint firstItem="O8A-fR-loh" firstAttribute="trailing" secondItem="8iU-Se-s8N" secondAttribute="trailing" id="gf6-0y-xJm"/>
|
||||
<constraint firstItem="Cdf-p5-Bbb" firstAttribute="top" secondItem="0EA-1u-hvB" secondAttribute="bottom" constant="5.5" id="k8B-gX-711"/>
|
||||
<constraint firstAttribute="trailing" secondItem="ZDx-fj-xoO" secondAttribute="trailing" constant="32" id="kDT-F8-g2Z"/>
|
||||
<constraint firstItem="ZDx-fj-xoO" firstAttribute="leading" secondItem="eSu-cK-AZG" secondAttribute="leading" constant="32" id="nfo-aZ-a2s"/>
|
||||
<constraint firstItem="XHd-bd-GsP" firstAttribute="trailing" secondItem="4NF-GO-a8Q" secondAttribute="trailing" id="pUf-gk-ebN"/>
|
||||
<constraint firstItem="Cdf-p5-Bbb" firstAttribute="leading" secondItem="XHd-bd-GsP" secondAttribute="leading" id="pfi-Os-bO3"/>
|
||||
<constraint firstItem="ZDx-fj-xoO" firstAttribute="top" secondItem="O8A-fR-loh" secondAttribute="bottom" constant="16" id="tjK-Iu-rKs"/>
|
||||
<constraint firstItem="XHd-bd-GsP" firstAttribute="leading" secondItem="4NF-GO-a8Q" secondAttribute="leading" id="u4f-BS-vwE"/>
|
||||
<constraint firstItem="O8A-fR-loh" firstAttribute="leading" secondItem="8iU-Se-s8N" secondAttribute="leading" id="xy5-u2-7s7"/>
|
||||
<constraint firstItem="4NF-GO-a8Q" firstAttribute="leading" secondItem="8iU-Se-s8N" secondAttribute="leading" id="yaF-Uc-O4D"/>
|
||||
<constraint firstAttribute="bottom" secondItem="AlH-L6-B76" secondAttribute="bottom" constant="16" id="0hs-Hp-ovP"/>
|
||||
<constraint firstAttribute="trailing" secondItem="AlH-L6-B76" secondAttribute="trailing" constant="16" id="EoK-Xs-7Wq"/>
|
||||
<constraint firstItem="AlH-L6-B76" firstAttribute="leading" secondItem="H2u-Ej-d0V" secondAttribute="leading" constant="16" id="HXk-yh-Vge"/>
|
||||
<constraint firstItem="AlH-L6-B76" firstAttribute="top" secondItem="H2u-Ej-d0V" secondAttribute="top" constant="16" id="cWx-3v-lTN"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" secondItem="eSu-cK-AZG" secondAttribute="height" priority="250" id="03a-SB-R0L"/>
|
||||
<constraint firstAttribute="bottom" secondItem="eSu-cK-AZG" secondAttribute="bottom" id="1ff-7f-KBT"/>
|
||||
<constraint firstItem="eSu-cK-AZG" firstAttribute="width" secondItem="C1g-0v-suZ" secondAttribute="width" id="ONL-A1-Af8"/>
|
||||
<constraint firstAttribute="trailing" secondItem="eSu-cK-AZG" secondAttribute="trailing" id="Uho-cx-qqJ"/>
|
||||
<constraint firstItem="eSu-cK-AZG" firstAttribute="leading" secondItem="C1g-0v-suZ" secondAttribute="leading" id="svO-9z-oYm"/>
|
||||
<constraint firstItem="eSu-cK-AZG" firstAttribute="top" secondItem="C1g-0v-suZ" secondAttribute="top" id="vzx-l3-qKJ"/>
|
||||
<constraint firstItem="H2u-Ej-d0V" firstAttribute="leading" secondItem="C1g-0v-suZ" secondAttribute="leading" id="1db-Wj-7VQ"/>
|
||||
<constraint firstItem="H2u-Ej-d0V" firstAttribute="top" secondItem="C1g-0v-suZ" secondAttribute="top" id="H12-lT-eSj"/>
|
||||
<constraint firstItem="H2u-Ej-d0V" firstAttribute="width" secondItem="C1g-0v-suZ" secondAttribute="width" id="VKb-hI-cl1"/>
|
||||
<constraint firstAttribute="trailing" secondItem="H2u-Ej-d0V" secondAttribute="trailing" id="ZgB-eU-Lll"/>
|
||||
<constraint firstAttribute="bottom" secondItem="H2u-Ej-d0V" secondAttribute="bottom" id="nz9-43-X14"/>
|
||||
<constraint firstItem="H2u-Ej-d0V" firstAttribute="height" secondItem="C1g-0v-suZ" secondAttribute="height" priority="250" id="uVu-Q9-sVr"/>
|
||||
</constraints>
|
||||
</scrollView>
|
||||
</subviews>
|
||||
|
|
|
@ -1,78 +0,0 @@
|
|||
#import "MWMAuthorizationViewModel.h"
|
||||
#import "Statistics.h"
|
||||
|
||||
#include <CoreApi/Framework.h>
|
||||
|
||||
@implementation MWMAuthorizationViewModel
|
||||
|
||||
+ (NSURL * _Nullable)phoneAuthURL
|
||||
{
|
||||
return [NSURL URLWithString:@(GetFramework().GetUser().GetPhoneAuthUrl("http://localhost").c_str())];
|
||||
}
|
||||
|
||||
+ (BOOL)isAuthenticated { return GetFramework().GetUser().IsAuthenticated(); }
|
||||
|
||||
+ (void)authenticateWithToken:(NSString * _Nonnull)token
|
||||
type:(MWMSocialTokenType)type
|
||||
privacyAccepted:(BOOL)privacyAccepted
|
||||
termsAccepted:(BOOL)termsAccepted
|
||||
promoAccepted:(BOOL)promoAccepted
|
||||
source:(MWMAuthorizationSource)source
|
||||
onComplete:(MWMAuthorizationCompleteBlock)onComplete
|
||||
{
|
||||
auto & user = GetFramework().GetUser();
|
||||
User::SocialTokenType socialTokenType;
|
||||
NSString * provider = nil;
|
||||
switch (type)
|
||||
{
|
||||
case MWMSocialTokenTypeGoogle:
|
||||
provider = kStatGoogle;
|
||||
socialTokenType = User::SocialTokenType::Google;
|
||||
break;
|
||||
case MWMSocialTokenTypeFacebook:
|
||||
provider = kStatFacebook;
|
||||
socialTokenType = User::SocialTokenType::Facebook;
|
||||
break;
|
||||
case MWMSocialTokenTypePhone:
|
||||
provider = kStatPhone;
|
||||
socialTokenType = User::SocialTokenType::Phone;
|
||||
break;
|
||||
}
|
||||
auto s = std::make_unique<User::Subscriber>();
|
||||
s->m_postCallAction = User::Subscriber::Action::RemoveSubscriber;
|
||||
s->m_onAuthenticate = [provider, source, onComplete](bool success) {
|
||||
NSString * event = nil;
|
||||
switch (source)
|
||||
{
|
||||
case MWMAuthorizationSourceUGC:
|
||||
event = success ? kStatUGCReviewAuthRequestSuccess : kStatUGCReviewAuthError;
|
||||
break;
|
||||
case MWMAuthorizationSourceBookmarks:
|
||||
event = success ? kStatBookmarksAuthRequestSuccess : kStatBookmarksAuthRequestError;
|
||||
break;
|
||||
}
|
||||
|
||||
if (success)
|
||||
[Statistics logEvent:event withParameters:@{kStatProvider: provider}];
|
||||
else
|
||||
[Statistics logEvent:event withParameters:@{kStatProvider: kStatMapsme, kStatError: @""}];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
onComplete(success);
|
||||
});
|
||||
};
|
||||
user.AddSubscriber(std::move(s));
|
||||
user.Authenticate(token.UTF8String, socialTokenType, privacyAccepted,
|
||||
termsAccepted, promoAccepted);
|
||||
}
|
||||
|
||||
+ (NSString * _Nonnull)termsOfUseLink
|
||||
{
|
||||
return @(User::GetTermsOfUseLink().c_str());
|
||||
}
|
||||
|
||||
+ (NSString * _Nonnull)privacyPolicyLink
|
||||
{
|
||||
return @(User::GetPrivacyPolicyLink().c_str());
|
||||
}
|
||||
|
||||
@end
|
|
@ -2,7 +2,7 @@ class PhoneNumberAuthorizationViewController: WebViewController {
|
|||
var failure: MWMVoidBlock?
|
||||
|
||||
init(success: @escaping MWMStringBlock, failure: @escaping MWMVoidBlock) {
|
||||
super.init(authURL: MWMAuthorizationViewModel.phoneAuthURL()!, onSuccessAuth: success, onFailure: failure)!
|
||||
super.init(authURL: User.phoneAuthURL()!, onSuccessAuth: success, onFailure: failure)!
|
||||
self.failure = failure
|
||||
}
|
||||
|
||||
|
|
|
@ -702,7 +702,7 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page:
|
|||
}
|
||||
[Statistics logEvent:kStatUGCReviewStart
|
||||
withParameters:@{
|
||||
kStatIsAuthenticated: @([MWMAuthorizationViewModel isAuthenticated]),
|
||||
kStatIsAuthenticated: @([MWMUser isAuthenticated]),
|
||||
kStatIsOnline:
|
||||
@(GetPlatform().ConnectionStatus() != Platform::EConnectionType::CONNECTION_NONE),
|
||||
kStatMode: kStatAdd,
|
||||
|
|
|
@ -84,8 +84,8 @@ final class UGCAddReviewController: MWMTableViewController {
|
|||
let onError = { Toast.toast(withText: L("ugc_thanks_message_not_auth")).show() }
|
||||
let onComplete = { () -> Void in nc.popToRootViewController(animated: true) }
|
||||
|
||||
if MWMAuthorizationViewModel.isAuthenticated() || !FrameworkHelper.isNetworkConnected() {
|
||||
if MWMAuthorizationViewModel.isAuthenticated() {
|
||||
if User.isAuthenticated() || !FrameworkHelper.isNetworkConnected() {
|
||||
if User.isAuthenticated() {
|
||||
onSuccess()
|
||||
} else {
|
||||
onError()
|
||||
|
|
|
@ -7,8 +7,8 @@ class TermsOfUsePresenter {
|
|||
private weak var view: ITermsOfUseView?
|
||||
private let router: WelcomeRouterProtocol
|
||||
|
||||
let privacyPolicyLink = MWMAuthorizationViewModel.privacyPolicyLink()
|
||||
let termsOfUseLink = MWMAuthorizationViewModel.termsOfUseLink()
|
||||
let privacyPolicyLink = User.privacyPolicyLink()
|
||||
let termsOfUseLink = User.termsOfUseLink()
|
||||
|
||||
init(view: ITermsOfUseView, router: WelcomeRouterProtocol) {
|
||||
self.view = view
|
||||
|
|
Loading…
Add table
Reference in a new issue