From af36b38d44a18794b2858efc746e1664aa40ee9e Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Thu, 4 Jan 2024 11:24:03 -0800 Subject: [PATCH 1/2] [auth-swift] TODO review and ObjC Sample delete --- .../Swift/ActionCode/ActionCodeURL.swift | 4 +- FirebaseAuth/Sources/Swift/Auth/Auth.swift | 11 +- .../Sources/Swift/Auth/AuthComponent.swift | 5 +- .../AuthProvider/PhoneAuthProvider.swift | 2 - .../Sources/Swift/Backend/AuthBackend.swift | 2 +- .../Backend/AuthRequestConfiguration.swift | 2 - .../RPC/VerifyPhoneNumberResponse.swift | 2 +- .../SystemService/AuthAppCredential.swift | 10 +- FirebaseAuth/Sources/Swift/User/User.swift | 5 +- .../Sources/Swift/User/UserMetadata.swift | 3 +- .../Swift/Utilities/AuthErrorUtils.swift | 7 +- .../Sources/Swift/Utilities/AuthErrors.swift | 2 +- .../Utilities/AuthRecaptchaVerifier.swift | 8 +- .../AuthSample.xcodeproj/project.pbxproj | 944 ------------------ .../xcschemes/AuthSample.xcscheme | 117 --- .../xcschemes/Auth_ApiTests.xcscheme | 86 -- .../xcschemes/Auth_E2eTests.xcscheme | 86 -- .../xcschemes/SwiftApiTests.xcscheme | 77 -- .../Tests/Sample/E2eTests/BYOAuthTests.m | 86 -- .../Tests/Sample/E2eTests/FIRAuthE2eTests.m | 56 -- .../Sample/E2eTests/FIRAuthE2eTestsBase.h | 42 - .../Sample/E2eTests/FIRAuthE2eTestsBase.m | 70 -- FirebaseAuth/Tests/Sample/E2eTests/Info.plist | 22 - .../Sample/E2eTests/VerifyIOSClientTests.m | 38 - FirebaseAuth/Tests/Sample/Podfile | 36 - FirebaseAuth/Tests/Sample/README.md | 90 -- FirebaseAuth/Tests/Sample/Sample/AppManager.h | 80 -- FirebaseAuth/Tests/Sample/Sample/AppManager.m | 128 --- .../Tests/Sample/Sample/ApplicationDelegate.h | 48 - .../Tests/Sample/Sample/ApplicationDelegate.m | 102 -- .../Sample/Sample/ApplicationTemplate.plist | 88 -- .../Sample/Sample/AuthCredentialsTemplate.h | 33 - .../Tests/Sample/Sample/AuthProviders.h | 74 -- .../Tests/Sample/Sample/AuthProviders.m | 40 - .../Sample/AuthSample-Bridging-Header.h | 16 - .../CustomTokenDataEntryViewController.h | 55 - .../CustomTokenDataEntryViewController.m | 148 --- FirebaseAuth/Tests/Sample/Sample/Dummy.swift | 17 - .../Sample/Sample/FacebookAuthProvider.h | 29 - .../Sample/Sample/FacebookAuthProvider.m | 79 -- .../Tests/Sample/Sample/GoogleAuthProvider.h | 29 - .../Tests/Sample/Sample/GoogleAuthProvider.m | 56 -- .../AppIcon.appiconset/Contents.json | 204 ---- .../Icon-App-83.5x83.5@2x.png | Bin 1237 -> 0 bytes .../AppIcon.appiconset/ItunesArtwork@2x.png | Bin 23825 -> 0 bytes ...ar_square_grey_color_1x_ios_21in29dp-1.png | Bin 169 -> 0 bytes ...atar_square_grey_color_1x_ios_21in29dp.png | Bin 169 -> 0 bytes ...ar_square_grey_color_1x_ios_29in40dp-1.png | Bin 194 -> 0 bytes ...atar_square_grey_color_1x_ios_38in50dp.png | Bin 222 -> 0 bytes ...atar_square_grey_color_1x_ios_42in57dp.png | Bin 251 -> 0 bytes ...atar_square_grey_color_1x_ios_53in72dp.png | Bin 303 -> 0 bytes ...atar_square_grey_color_1x_ios_56in76dp.png | Bin 315 -> 0 bytes ...ar_square_grey_color_2x_ios_21in29dp-1.png | Bin 248 -> 0 bytes ...atar_square_grey_color_2x_ios_21in29dp.png | Bin 248 -> 0 bytes ...ar_square_grey_color_2x_ios_29in40dp-1.png | Bin 317 -> 0 bytes ...ar_square_grey_color_2x_ios_29in40dp-2.png | Bin 317 -> 0 bytes ...atar_square_grey_color_2x_ios_38in50dp.png | Bin 390 -> 0 bytes ...atar_square_grey_color_2x_ios_42in57dp.png | Bin 424 -> 0 bytes ...atar_square_grey_color_2x_ios_44in60dp.png | Bin 438 -> 0 bytes ...atar_square_grey_color_2x_ios_53in72dp.png | Bin 540 -> 0 bytes ...atar_square_grey_color_2x_ios_56in76dp.png | Bin 573 -> 0 bytes ...atar_square_grey_color_3x_ios_21in29dp.png | Bin 330 -> 0 bytes ...ar_square_grey_color_3x_ios_29in40dp-1.png | Bin 433 -> 0 bytes ...atar_square_grey_color_3x_ios_44in60dp.png | Bin 661 -> 0 bytes .../Sample/Images.xcassets/Contents.json | 6 - .../Sample/Sample/MainViewController+App.h | 31 - .../Sample/Sample/MainViewController+App.m | 190 ---- .../Sample/Sample/MainViewController+Auth.h | 39 - .../Sample/Sample/MainViewController+Auth.m | 108 -- .../Sample/MainViewController+AutoTests.h | 31 - .../Sample/MainViewController+AutoTests.m | 500 ---------- .../Sample/Sample/MainViewController+Custom.h | 31 - .../Sample/Sample/MainViewController+Custom.m | 72 -- .../Sample/Sample/MainViewController+Email.h | 38 - .../Sample/Sample/MainViewController+Email.m | 350 ------- .../Sample/MainViewController+Facebook.h | 31 - .../Sample/MainViewController+Facebook.m | 56 -- .../Sample/MainViewController+GameCenter.h | 32 - .../Sample/MainViewController+GameCenter.m | 123 --- .../Sample/Sample/MainViewController+Google.h | 31 - .../Sample/Sample/MainViewController+Google.m | 130 --- .../Sample/MainViewController+Internal.h | 103 -- .../Sample/MainViewController+MultiFactor.h | 31 - .../Sample/MainViewController+MultiFactor.m | 161 --- .../Sample/Sample/MainViewController+OAuth.h | 31 - .../Sample/Sample/MainViewController+OAuth.m | 493 --------- .../Sample/Sample/MainViewController+OOB.h | 36 - .../Sample/Sample/MainViewController+OOB.m | 273 ----- .../Sample/Sample/MainViewController+Phone.h | 41 - .../Sample/Sample/MainViewController+Phone.m | 211 ---- .../Sample/Sample/MainViewController+User.h | 37 - .../Sample/Sample/MainViewController+User.m | 276 ----- .../Tests/Sample/Sample/MainViewController.h | 70 -- .../Tests/Sample/Sample/MainViewController.m | 721 ------------- .../Sample/Sample/MainViewController.xib | 334 ------- .../Sample/Sample/SampleTemplate.entitlements | 14 - .../Sample/Sample/SettingsViewController.h | 37 - .../Sample/Sample/SettingsViewController.m | 426 -------- .../Sample/Sample/SettingsViewController.xib | 46 - .../Sample/StaticContentTableViewManager.h | 255 ----- .../Sample/StaticContentTableViewManager.m | 243 ----- .../Sample/Sample/UIViewController+Alerts.h | 101 -- .../Sample/Sample/UIViewController+Alerts.m | 410 -------- .../Sample/Sample/UserInfoViewController.h | 55 - .../Sample/Sample/UserInfoViewController.m | 109 -- .../Sample/Sample/UserInfoViewController.xib | 46 - .../Tests/Sample/Sample/UserTableViewCell.h | 58 -- .../Tests/Sample/Sample/UserTableViewCell.m | 55 - FirebaseAuth/Tests/Sample/Sample/main.m | 23 - 109 files changed, 26 insertions(+), 9508 deletions(-) delete mode 100644 FirebaseAuth/Tests/Sample/AuthSample.xcodeproj/project.pbxproj delete mode 100644 FirebaseAuth/Tests/Sample/AuthSample.xcodeproj/xcshareddata/xcschemes/AuthSample.xcscheme delete mode 100644 FirebaseAuth/Tests/Sample/AuthSample.xcodeproj/xcshareddata/xcschemes/Auth_ApiTests.xcscheme delete mode 100644 FirebaseAuth/Tests/Sample/AuthSample.xcodeproj/xcshareddata/xcschemes/Auth_E2eTests.xcscheme delete mode 100644 FirebaseAuth/Tests/Sample/AuthSample.xcodeproj/xcshareddata/xcschemes/SwiftApiTests.xcscheme delete mode 100644 FirebaseAuth/Tests/Sample/E2eTests/BYOAuthTests.m delete mode 100644 FirebaseAuth/Tests/Sample/E2eTests/FIRAuthE2eTests.m delete mode 100644 FirebaseAuth/Tests/Sample/E2eTests/FIRAuthE2eTestsBase.h delete mode 100644 FirebaseAuth/Tests/Sample/E2eTests/FIRAuthE2eTestsBase.m delete mode 100644 FirebaseAuth/Tests/Sample/E2eTests/Info.plist delete mode 100644 FirebaseAuth/Tests/Sample/E2eTests/VerifyIOSClientTests.m delete mode 100644 FirebaseAuth/Tests/Sample/Podfile delete mode 100644 FirebaseAuth/Tests/Sample/README.md delete mode 100644 FirebaseAuth/Tests/Sample/Sample/AppManager.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/AppManager.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/ApplicationDelegate.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/ApplicationDelegate.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/ApplicationTemplate.plist delete mode 100644 FirebaseAuth/Tests/Sample/Sample/AuthCredentialsTemplate.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/AuthProviders.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/AuthProviders.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/AuthSample-Bridging-Header.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/CustomTokenDataEntryViewController.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/CustomTokenDataEntryViewController.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Dummy.swift delete mode 100644 FirebaseAuth/Tests/Sample/Sample/FacebookAuthProvider.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/FacebookAuthProvider.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/GoogleAuthProvider.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/GoogleAuthProvider.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_1x_ios_21in29dp-1.png delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_1x_ios_21in29dp.png delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_1x_ios_29in40dp-1.png delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_1x_ios_38in50dp.png delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_1x_ios_42in57dp.png delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_1x_ios_53in72dp.png delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_1x_ios_56in76dp.png delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_2x_ios_21in29dp-1.png delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_2x_ios_21in29dp.png delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_2x_ios_29in40dp-1.png delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_2x_ios_29in40dp-2.png delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_2x_ios_38in50dp.png delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_2x_ios_42in57dp.png delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_2x_ios_44in60dp.png delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_2x_ios_53in72dp.png delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_2x_ios_56in76dp.png delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_3x_ios_21in29dp.png delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_3x_ios_29in40dp-1.png delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_3x_ios_44in60dp.png delete mode 100644 FirebaseAuth/Tests/Sample/Sample/Images.xcassets/Contents.json delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+App.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+App.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+Auth.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+Auth.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+AutoTests.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+AutoTests.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+Custom.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+Custom.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+Email.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+Email.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+Facebook.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+Facebook.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+GameCenter.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+GameCenter.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+Google.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+Google.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+Internal.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+MultiFactor.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+MultiFactor.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+OAuth.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+OAuth.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+OOB.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+OOB.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+Phone.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+Phone.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+User.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController+User.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/MainViewController.xib delete mode 100644 FirebaseAuth/Tests/Sample/Sample/SampleTemplate.entitlements delete mode 100644 FirebaseAuth/Tests/Sample/Sample/SettingsViewController.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/SettingsViewController.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/SettingsViewController.xib delete mode 100644 FirebaseAuth/Tests/Sample/Sample/StaticContentTableViewManager.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/StaticContentTableViewManager.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/UIViewController+Alerts.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/UIViewController+Alerts.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/UserInfoViewController.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/UserInfoViewController.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/UserInfoViewController.xib delete mode 100644 FirebaseAuth/Tests/Sample/Sample/UserTableViewCell.h delete mode 100644 FirebaseAuth/Tests/Sample/Sample/UserTableViewCell.m delete mode 100644 FirebaseAuth/Tests/Sample/Sample/main.m diff --git a/FirebaseAuth/Sources/Swift/ActionCode/ActionCodeURL.swift b/FirebaseAuth/Sources/Swift/ActionCode/ActionCodeURL.swift index e55b1e77f5a..5c5eba4085b 100644 --- a/FirebaseAuth/Sources/Swift/ActionCode/ActionCodeURL.swift +++ b/FirebaseAuth/Sources/Swift/ActionCode/ActionCodeURL.swift @@ -71,9 +71,7 @@ import Foundation languageCode = queryItems["languageCode"] } - // TODO: internal below here. - - @objc public class func parseURL(_ urlString: String) -> [String: String] { + class func parseURL(_ urlString: String) -> [String: String] { guard let linkURL = URLComponents(string: urlString)?.query else { return [:] } diff --git a/FirebaseAuth/Sources/Swift/Auth/Auth.swift b/FirebaseAuth/Sources/Swift/Auth/Auth.swift index 0807a4e0104..9d249ce907f 100644 --- a/FirebaseAuth/Sources/Swift/Auth/Auth.swift +++ b/FirebaseAuth/Sources/Swift/Auth/Auth.swift @@ -93,7 +93,7 @@ extension Auth: AuthInterop { strongSelf.autoRefreshTokens = true strongSelf.scheduleAutoTokenRefresh() - #if os(iOS) || os(tvOS) // TODO: Is a similar mechanism needed on macOS? + #if os(iOS) || os(tvOS) // TODO(from ObjC): Is a similar mechanism needed on macOS? strongSelf.applicationDidBecomeActiveObserver = NotificationCenter.default.addObserver( forName: UIApplication.didBecomeActiveNotification, @@ -1593,7 +1593,10 @@ extension Auth: AuthInterop { @param listenerHandle The handle for the listener. */ @objc public func removeIDTokenDidChangeListener(_ listenerHandle: NSObjectProtocol) { - // TODO: implement me + NotificationCenter.default.removeObserver(listenerHandle) + objc_sync_enter(Auth.self) + listenerHandles.remove(listenerHandle) + objc_sync_exit(Auth.self) } /** @fn useAppLanguage @@ -1768,10 +1771,6 @@ extension Auth: AuthInterop { } #endif - // TODO: Need to manage breaking change for - // const NSNotificationName FIRAuthStateDidChangeNotification = - // @"FIRAuthStateDidChangeNotification"; - // Move to FIRApp with other Auth notifications? public static let authStateDidChangeNotification = NSNotification.Name(rawValue: "FIRAuthStateDidChangeNotification") diff --git a/FirebaseAuth/Sources/Swift/Auth/AuthComponent.swift b/FirebaseAuth/Sources/Swift/Auth/AuthComponent.swift index 1bc185b52c2..f0be914d6a6 100644 --- a/FirebaseAuth/Sources/Swift/Auth/AuthComponent.swift +++ b/FirebaseAuth/Sources/Swift/Auth/AuthComponent.swift @@ -23,7 +23,8 @@ import Foundation } @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *) -@objc(FIRAuthComponent) class AuthComponent: NSObject, Library, AuthProvider { +@objc(FIRAuthComponent) +class AuthComponent: NSObject, Library, AuthProvider, ComponentLifecycleMaintainer { // MARK: - Private Variables /// The app associated with all Auth instances in this container. @@ -85,7 +86,7 @@ import Foundation try? keychain.removeData(forKey: userKey) } DispatchQueue.main.async { - // TODO: Move over to fire an event instead, once ready. + // TODO(ObjC): Move over to fire an event instead, once ready. NotificationCenter.default.post(name: Auth.authStateDidChangeNotification, object: nil) } } diff --git a/FirebaseAuth/Sources/Swift/AuthProvider/PhoneAuthProvider.swift b/FirebaseAuth/Sources/Swift/AuthProvider/PhoneAuthProvider.swift index 2b5bab1209e..bce8092a7ac 100644 --- a/FirebaseAuth/Sources/Swift/AuthProvider/PhoneAuthProvider.swift +++ b/FirebaseAuth/Sources/Swift/AuthProvider/PhoneAuthProvider.swift @@ -39,8 +39,6 @@ import Foundation return PhoneAuthProvider(auth: auth) } - // TODO: review/remove public objc - /** @brief Starts the phone number authentication flow by sending a verification code to the specified phone number. diff --git a/FirebaseAuth/Sources/Swift/Backend/AuthBackend.swift b/FirebaseAuth/Sources/Swift/Backend/AuthBackend.swift index b163dcb3022..ba7bb4e6137 100644 --- a/FirebaseAuth/Sources/Swift/Backend/AuthBackend.swift +++ b/FirebaseAuth/Sources/Swift/Backend/AuthBackend.swift @@ -291,7 +291,7 @@ private class AuthBackendRPCImplementation: NSObject, AuthBackendImplementation return } else { // TODO: this was ignored before - fatalError("Internal error") + fatalError("Auth Internal error: RPC call didn't return data or an error.") } } // Try to decode the HTTP response data which may contain either a diff --git a/FirebaseAuth/Sources/Swift/Backend/AuthRequestConfiguration.swift b/FirebaseAuth/Sources/Swift/Backend/AuthRequestConfiguration.swift index 380405f9a01..80ce4a79ac7 100644 --- a/FirebaseAuth/Sources/Swift/Backend/AuthRequestConfiguration.swift +++ b/FirebaseAuth/Sources/Swift/Backend/AuthRequestConfiguration.swift @@ -15,8 +15,6 @@ import Foundation import FirebaseAppCheckInterop -// TODO: Investigate how to directly depend on FIRHeartbeatLogger instead of using a protocol so -// FirebaseCoreExtension can be an implementation only protocol. import FirebaseCoreExtension /** @class FIRAuthRequestConfiguration diff --git a/FirebaseAuth/Sources/Swift/Backend/RPC/VerifyPhoneNumberResponse.swift b/FirebaseAuth/Sources/Swift/Backend/RPC/VerifyPhoneNumberResponse.swift index d2ffedf6e48..9ac4821ed37 100644 --- a/FirebaseAuth/Sources/Swift/Backend/RPC/VerifyPhoneNumberResponse.swift +++ b/FirebaseAuth/Sources/Swift/Backend/RPC/VerifyPhoneNumberResponse.swift @@ -55,7 +55,7 @@ class VerifyPhoneNumberResponse: AuthRPCResponse { */ var approximateExpirationDate: Date? - // XXX TODO: What might this be? + // XXX TODO(ObjC): What might this be? func expectedKind() -> String? { nil } diff --git a/FirebaseAuth/Sources/Swift/SystemService/AuthAppCredential.swift b/FirebaseAuth/Sources/Swift/SystemService/AuthAppCredential.swift index 413c31b08ed..f44c3952295 100644 --- a/FirebaseAuth/Sources/Swift/SystemService/AuthAppCredential.swift +++ b/FirebaseAuth/Sources/Swift/SystemService/AuthAppCredential.swift @@ -24,21 +24,19 @@ private let kReceiptKey = "receipt" */ private let kSecretKey = "secret" -// TODO: Remove objc public after Sample app is replaced. - /** @class FIRAuthAppCredential @brief A class represents a credential that proves the identity of the app. */ -@objc(FIRAuthAppCredential) public class AuthAppCredential: NSObject, NSSecureCoding { +class AuthAppCredential: NSObject, NSSecureCoding { /** @property receipt @brief The server acknowledgement of receiving client's claim of identity. */ - @objc public var receipt: String + var receipt: String /** @property secret @brief The secret that the client received from server via a trusted channel, if ever. */ - @objc public var secret: String? + var secret: String? /** @fn initWithReceipt:secret: @brief Initializes the instance. @@ -46,7 +44,7 @@ private let kSecretKey = "secret" @param secret The secret that the client received from server via a trusted channel, if ever. @return The initialized instance. */ - @objc public init(receipt: String, secret: String?) { + init(receipt: String, secret: String?) { self.secret = secret self.receipt = receipt } diff --git a/FirebaseAuth/Sources/Swift/User/User.swift b/FirebaseAuth/Sources/Swift/User/User.swift index 86a05d0f27b..7f26ca56e54 100644 --- a/FirebaseAuth/Sources/Swift/User/User.swift +++ b/FirebaseAuth/Sources/Swift/User/User.swift @@ -302,12 +302,11 @@ extension User: NSSecureCoding {} */ @objc(profileChangeRequest) public func createProfileChangeRequest() -> UserProfileChangeRequest { - var result: UserProfileChangeRequest? + var result: UserProfileChangeRequest! kAuthGlobalWorkQueue.sync { result = UserProfileChangeRequest(self) } - // TODO: Is there a way to do without force unwrap? - return result! + return result } /** @property refreshToken diff --git a/FirebaseAuth/Sources/Swift/User/UserMetadata.swift b/FirebaseAuth/Sources/Swift/User/UserMetadata.swift index 533ca24ec4a..38cc1aadade 100644 --- a/FirebaseAuth/Sources/Swift/User/UserMetadata.swift +++ b/FirebaseAuth/Sources/Swift/User/UserMetadata.swift @@ -29,8 +29,7 @@ import Foundation */ @objc public let creationDate: Date? - // TODO: Nothing public below here - @objc public init(withCreationDate creationDate: Date?, lastSignInDate: Date?) { + init(withCreationDate creationDate: Date?, lastSignInDate: Date?) { self.creationDate = creationDate self.lastSignInDate = lastSignInDate } diff --git a/FirebaseAuth/Sources/Swift/Utilities/AuthErrorUtils.swift b/FirebaseAuth/Sources/Swift/Utilities/AuthErrorUtils.swift index cb9e3b85e7a..0496997fc33 100644 --- a/FirebaseAuth/Sources/Swift/Utilities/AuthErrorUtils.swift +++ b/FirebaseAuth/Sources/Swift/Utilities/AuthErrorUtils.swift @@ -535,13 +535,12 @@ class AuthErrorUtils: NSObject { } #if os(iOS) - // TODO(ncooke3): Address the optionality of these arguments. static func secondFactorRequiredError(pendingCredential: String?, - hints: [MultiFactorInfo]?, + hints: [MultiFactorInfo], auth: Auth) -> Error { var userInfo: [String: Any] = [:] - if let pendingCredential = pendingCredential, let hints = hints { + if let pendingCredential = pendingCredential { let resolver = MultiFactorResolver(with: pendingCredential, hints: hints, auth: auth) userInfo[AuthErrors.userInfoMultiFactorResolverKey] = resolver } @@ -551,7 +550,7 @@ class AuthErrorUtils: NSObject { #endif // os(iOS) static func recaptchaSDKNotLinkedError() -> Error { - // TODO(chuanr): point the link to GCIP doc once available. + // TODO(chuanr, ObjC): point the link to GCIP doc once available. let message = "The reCAPTCHA SDK is not linked to your app. See " + "https://cloud.google.com/recaptcha-enterprise/docs/instrument-ios-apps" return error(code: .recaptchaSDKNotLinked, message: message) diff --git a/FirebaseAuth/Sources/Swift/Utilities/AuthErrors.swift b/FirebaseAuth/Sources/Swift/Utilities/AuthErrors.swift index 780205b351c..81217d470de 100644 --- a/FirebaseAuth/Sources/Swift/Utilities/AuthErrors.swift +++ b/FirebaseAuth/Sources/Swift/Utilities/AuthErrors.swift @@ -1318,7 +1318,7 @@ private let kFIRAuthErrorMessageInvalidRecaptchaVersion = private let kFIRAuthErrorMessageInvalidReqType = "The request is not supported or is invalid." -// TODO(chuanr): point the link to GCIP doc once available. +// TODO(chuanr, ObjC): point the link to GCIP doc once available. private let kFIRAuthErrorMessageRecaptchaSDKNotLinked = "The reCAPTCHA SDK is not linked to your app. See " + "https://cloud.google.com/recaptcha-enterprise/docs/instrument-ios-apps" diff --git a/FirebaseAuth/Sources/Swift/Utilities/AuthRecaptchaVerifier.swift b/FirebaseAuth/Sources/Swift/Utilities/AuthRecaptchaVerifier.swift index efb732c9957..98d837d1d83 100644 --- a/FirebaseAuth/Sources/Swift/Utilities/AuthRecaptchaVerifier.swift +++ b/FirebaseAuth/Sources/Swift/Utilities/AuthRecaptchaVerifier.swift @@ -114,17 +114,17 @@ let customAction = actionClass.init(customAction: actionString) do { let token = try await recaptchaClient?.execute(withAction: customAction) - AuthLog.logInfo(code: "TODO", message: "reCAPTCHA token retrieval succeeded.") + AuthLog.logInfo(code: "I-AUT000100", message: "reCAPTCHA token retrieval succeeded.") guard let token else { AuthLog.logInfo( - code: "TODO", + code: "I-AUT000101", message: "reCAPTCHA token retrieval returned nil. NO_RECAPTCHA sent as the fake code." ) return "NO_RECAPTCHA" } return token } catch { - AuthLog.logInfo(code: "TODO", + AuthLog.logInfo(code: "I-AUT000102", message: "reCAPTCHA token retrieval failed. NO_RECAPTCHA sent as the fake code.") return "NO_RECAPTCHA" } @@ -147,7 +147,7 @@ } let request = GetRecaptchaConfigRequest(requestConfiguration: requestConfiguration) let response = try await AuthBackend.call(with: request) - AuthLog.logInfo(code: "TODO-CODE", message: "reCAPTCHA config retrieval succeeded.") + AuthLog.logInfo(code: "I-AUT000103", message: "reCAPTCHA config retrieval succeeded.") // Response's site key is of the format projects//keys/' guard let keys = response.recaptchaKey?.components(separatedBy: "/"), keys.count == 4 else { diff --git a/FirebaseAuth/Tests/Sample/AuthSample.xcodeproj/project.pbxproj b/FirebaseAuth/Tests/Sample/AuthSample.xcodeproj/project.pbxproj deleted file mode 100644 index f118815609d..00000000000 --- a/FirebaseAuth/Tests/Sample/AuthSample.xcodeproj/project.pbxproj +++ /dev/null @@ -1,944 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 50; - objects = { - -/* Begin PBXBuildFile section */ - 400283EA23EA254B0006A298 /* MainViewController+MultiFactor.m in Sources */ = {isa = PBXBuildFile; fileRef = 400283E923EA254A0006A298 /* MainViewController+MultiFactor.m */; }; - DE1865AC245B879B00F8AD70 /* TestsBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE1865AB245B879B00F8AD70 /* TestsBase.swift */; }; - DE1865AE245B8A1400F8AD70 /* AnonymousTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE1865AD245B8A1400F8AD70 /* AnonymousTests.swift */; }; - DE1865B2245C7A2B00F8AD70 /* EmailPasswordTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE1865B1245C7A2B00F8AD70 /* EmailPasswordTests.swift */; }; - DE1865B4245C92A600F8AD70 /* GoogleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE1865B3245C92A600F8AD70 /* GoogleTests.swift */; }; - DE1865B6245C95DA00F8AD70 /* Credentials.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE1865B5245C95DA00F8AD70 /* Credentials.swift */; }; - DE1865B8245CC6FC00F8AD70 /* FacebookTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE1865B7245CC6FC00F8AD70 /* FacebookTests.swift */; }; - DE800B4722A2F8AF00AC9A23 /* MainViewController+Custom.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B1122A2F8AF00AC9A23 /* MainViewController+Custom.m */; }; - DE800B4822A2F8AF00AC9A23 /* SettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B1222A2F8AF00AC9A23 /* SettingsViewController.m */; }; - DE800B4922A2F8AF00AC9A23 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = DE800B1322A2F8AF00AC9A23 /* MainViewController.xib */; }; - DE800B4A22A2F8AF00AC9A23 /* GoogleAuthProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B1422A2F8AF00AC9A23 /* GoogleAuthProvider.m */; }; - DE800B4B22A2F8AF00AC9A23 /* MainViewController+User.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B1822A2F8AF00AC9A23 /* MainViewController+User.m */; }; - DE800B4C22A2F8AF00AC9A23 /* MainViewController+GameCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B1922A2F8AF00AC9A23 /* MainViewController+GameCenter.m */; }; - DE800B4D22A2F8AF00AC9A23 /* MainViewController+Phone.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B1A22A2F8AF00AC9A23 /* MainViewController+Phone.m */; }; - DE800B4E22A2F8AF00AC9A23 /* UserTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B1B22A2F8AF00AC9A23 /* UserTableViewCell.m */; }; - DE800B4F22A2F8AF00AC9A23 /* MainViewController+Facebook.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B1C22A2F8AF00AC9A23 /* MainViewController+Facebook.m */; }; - DE800B5022A2F8AF00AC9A23 /* UIViewController+Alerts.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B2022A2F8AF00AC9A23 /* UIViewController+Alerts.m */; }; - DE800B5122A2F8AF00AC9A23 /* MainViewController+Email.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B2222A2F8AF00AC9A23 /* MainViewController+Email.m */; }; - DE800B5222A2F8AF00AC9A23 /* MainViewController+Auth.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B2322A2F8AF00AC9A23 /* MainViewController+Auth.m */; }; - DE800B5422A2F8AF00AC9A23 /* UserInfoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = DE800B2822A2F8AF00AC9A23 /* UserInfoViewController.xib */; }; - DE800B5522A2F8AF00AC9A23 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B2922A2F8AF00AC9A23 /* MainViewController.m */; }; - DE800B5622A2F8AF00AC9A23 /* MainViewController+AutoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B2B22A2F8AF00AC9A23 /* MainViewController+AutoTests.m */; }; - DE800B5722A2F8AF00AC9A23 /* MainViewController+OOB.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B2C22A2F8AF00AC9A23 /* MainViewController+OOB.m */; }; - DE800B5822A2F8AF00AC9A23 /* AppManager.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B2D22A2F8AF00AC9A23 /* AppManager.m */; }; - DE800B5922A2F8AF00AC9A23 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B2E22A2F8AF00AC9A23 /* main.m */; }; - DE800B5A22A2F8AF00AC9A23 /* MainViewController+App.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B2F22A2F8AF00AC9A23 /* MainViewController+App.m */; }; - DE800B5B22A2F8AF00AC9A23 /* MainViewController+OAuth.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B3122A2F8AF00AC9A23 /* MainViewController+OAuth.m */; }; - DE800B5C22A2F8AF00AC9A23 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DE800B3222A2F8AF00AC9A23 /* Images.xcassets */; }; - DE800B5D22A2F8AF00AC9A23 /* UserInfoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B3422A2F8AF00AC9A23 /* UserInfoViewController.m */; }; - DE800B5E22A2F8AF00AC9A23 /* StaticContentTableViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B3622A2F8AF00AC9A23 /* StaticContentTableViewManager.m */; }; - DE800B5F22A2F8AF00AC9A23 /* MainViewController+Google.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B3922A2F8AF00AC9A23 /* MainViewController+Google.m */; }; - DE800B6022A2F8AF00AC9A23 /* FacebookAuthProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B3B22A2F8AF00AC9A23 /* FacebookAuthProvider.m */; }; - DE800B6122A2F8AF00AC9A23 /* ApplicationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B3C22A2F8AF00AC9A23 /* ApplicationDelegate.m */; }; - DE800B6222A2F8AF00AC9A23 /* CustomTokenDataEntryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B3D22A2F8AF00AC9A23 /* CustomTokenDataEntryViewController.m */; }; - DE800B6322A2F8AF00AC9A23 /* SettingsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = DE800B4122A2F8AF00AC9A23 /* SettingsViewController.xib */; }; - DE800B6422A2F8AF00AC9A23 /* AuthProviders.m in Sources */ = {isa = PBXBuildFile; fileRef = DE800B4522A2F8AF00AC9A23 /* AuthProviders.m */; }; - DE800B6722A2FF7300AC9A23 /* GoogleService-Info_multi.plist in Resources */ = {isa = PBXBuildFile; fileRef = DE800B6522A2FF7300AC9A23 /* GoogleService-Info_multi.plist */; }; - DE800B6822A2FF7300AC9A23 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = DE800B6622A2FF7300AC9A23 /* GoogleService-Info.plist */; }; - DEBEF60E245247A0005E1A8F /* AccountInfoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DEBEF60D245247A0005E1A8F /* AccountInfoTests.swift */; }; - DED400B0243E56F500BF6D56 /* FacebookAuthTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DED400A4243E56F500BF6D56 /* FacebookAuthTests.m */; }; - DED400B1243E56F500BF6D56 /* generate_refresh_token.sh in Resources */ = {isa = PBXBuildFile; fileRef = DED400A5243E56F500BF6D56 /* generate_refresh_token.sh */; }; - DED400B3243E56F500BF6D56 /* AnonymousAuthTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DED400A8243E56F500BF6D56 /* AnonymousAuthTests.m */; }; - DED400B5243E56F500BF6D56 /* AccountInfoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DED400AB243E56F500BF6D56 /* AccountInfoTests.m */; }; - DED400B6243E56F500BF6D56 /* EmailPasswordAuthTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DED400AC243E56F500BF6D56 /* EmailPasswordAuthTests.m */; }; - DED400B7243E56F500BF6D56 /* CustomAuthTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DED400AD243E56F500BF6D56 /* CustomAuthTests.m */; }; - DED400B8243E56F500BF6D56 /* GoogleAuthTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DED400AE243E56F500BF6D56 /* GoogleAuthTests.m */; }; - DED400B9243E56F500BF6D56 /* FIRAuthApiTestsBase.m in Sources */ = {isa = PBXBuildFile; fileRef = DED400AF243E56F500BF6D56 /* FIRAuthApiTestsBase.m */; }; - DED400C1243E571500BF6D56 /* VerifyIOSClientTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DED400BB243E571500BF6D56 /* VerifyIOSClientTests.m */; }; - DED400C2243E571500BF6D56 /* BYOAuthTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DED400BC243E571500BF6D56 /* BYOAuthTests.m */; }; - DED400C3243E571500BF6D56 /* FIRAuthE2eTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DED400BE243E571500BF6D56 /* FIRAuthE2eTests.m */; }; - DED400C4243E571500BF6D56 /* FIRAuthE2eTestsBase.m in Sources */ = {isa = PBXBuildFile; fileRef = DED400BF243E571500BF6D56 /* FIRAuthE2eTestsBase.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - DE800B7622A5927C00AC9A23 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = DE800AEC22A2F87E00AC9A23 /* Project object */; - proxyType = 1; - remoteGlobalIDString = DE800AF322A2F87E00AC9A23; - remoteInfo = AuthSample; - }; - DE800B9A22A5BD1800AC9A23 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = DE800AEC22A2F87E00AC9A23 /* Project object */; - proxyType = 1; - remoteGlobalIDString = DE800AF322A2F87E00AC9A23; - remoteInfo = AuthSample; - }; - DEBEF6082450EA27005E1A8F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = DE800AEC22A2F87E00AC9A23 /* Project object */; - proxyType = 1; - remoteGlobalIDString = DE800AF322A2F87E00AC9A23; - remoteInfo = AuthSample; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 400283E823EA254A0006A298 /* MainViewController+MultiFactor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MainViewController+MultiFactor.h"; sourceTree = ""; }; - 400283E923EA254A0006A298 /* MainViewController+MultiFactor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MainViewController+MultiFactor.m"; sourceTree = ""; }; - DE1865AB245B879B00F8AD70 /* TestsBase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestsBase.swift; sourceTree = ""; }; - DE1865AD245B8A1400F8AD70 /* AnonymousTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnonymousTests.swift; sourceTree = ""; }; - DE1865B1245C7A2B00F8AD70 /* EmailPasswordTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmailPasswordTests.swift; sourceTree = ""; }; - DE1865B3245C92A600F8AD70 /* GoogleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoogleTests.swift; sourceTree = ""; }; - DE1865B5245C95DA00F8AD70 /* Credentials.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Credentials.swift; sourceTree = ""; }; - DE1865B7245CC6FC00F8AD70 /* FacebookTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FacebookTests.swift; sourceTree = ""; }; - DE800AF422A2F87E00AC9A23 /* AuthSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AuthSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - DE800B0E22A2F8AF00AC9A23 /* AppManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppManager.h; sourceTree = ""; }; - DE800B0F22A2F8AF00AC9A23 /* MainViewController+AutoTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MainViewController+AutoTests.h"; sourceTree = ""; }; - DE800B1022A2F8AF00AC9A23 /* MainViewController+OOB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MainViewController+OOB.h"; sourceTree = ""; }; - DE800B1122A2F8AF00AC9A23 /* MainViewController+Custom.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MainViewController+Custom.m"; sourceTree = ""; }; - DE800B1222A2F8AF00AC9A23 /* SettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SettingsViewController.m; sourceTree = ""; }; - DE800B1322A2F8AF00AC9A23 /* MainViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainViewController.xib; sourceTree = ""; }; - DE800B1422A2F8AF00AC9A23 /* GoogleAuthProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GoogleAuthProvider.m; sourceTree = ""; }; - DE800B1522A2F8AF00AC9A23 /* UserInfoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserInfoViewController.h; sourceTree = ""; }; - DE800B1622A2F8AF00AC9A23 /* MainViewController+OAuth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MainViewController+OAuth.h"; sourceTree = ""; }; - DE800B1722A2F8AF00AC9A23 /* MainViewController+App.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MainViewController+App.h"; sourceTree = ""; }; - DE800B1822A2F8AF00AC9A23 /* MainViewController+User.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MainViewController+User.m"; sourceTree = ""; }; - DE800B1922A2F8AF00AC9A23 /* MainViewController+GameCenter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MainViewController+GameCenter.m"; sourceTree = ""; }; - DE800B1A22A2F8AF00AC9A23 /* MainViewController+Phone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MainViewController+Phone.m"; sourceTree = ""; }; - DE800B1B22A2F8AF00AC9A23 /* UserTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserTableViewCell.m; sourceTree = ""; }; - DE800B1C22A2F8AF00AC9A23 /* MainViewController+Facebook.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MainViewController+Facebook.m"; sourceTree = ""; }; - DE800B1D22A2F8AF00AC9A23 /* CustomTokenDataEntryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomTokenDataEntryViewController.h; sourceTree = ""; }; - DE800B1E22A2F8AF00AC9A23 /* FacebookAuthProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FacebookAuthProvider.h; sourceTree = ""; }; - DE800B1F22A2F8AF00AC9A23 /* ApplicationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplicationDelegate.h; sourceTree = ""; }; - DE800B2022A2F8AF00AC9A23 /* UIViewController+Alerts.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+Alerts.m"; sourceTree = ""; }; - DE800B2122A2F8AF00AC9A23 /* MainViewController+Google.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MainViewController+Google.h"; sourceTree = ""; }; - DE800B2222A2F8AF00AC9A23 /* MainViewController+Email.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MainViewController+Email.m"; sourceTree = ""; }; - DE800B2322A2F8AF00AC9A23 /* MainViewController+Auth.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MainViewController+Auth.m"; sourceTree = ""; }; - DE800B2422A2F8AF00AC9A23 /* StaticContentTableViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticContentTableViewManager.h; sourceTree = ""; }; - DE800B2522A2F8AF00AC9A23 /* SampleTemplate.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = SampleTemplate.entitlements; sourceTree = ""; }; - DE800B2622A2F8AF00AC9A23 /* AuthProviders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthProviders.h; sourceTree = ""; }; - DE800B2722A2F8AF00AC9A23 /* ApplicationTemplate.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = ApplicationTemplate.plist; sourceTree = ""; }; - DE800B2822A2F8AF00AC9A23 /* UserInfoViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UserInfoViewController.xib; sourceTree = ""; }; - DE800B2922A2F8AF00AC9A23 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = ""; }; - DE800B2A22A2F8AF00AC9A23 /* MainViewController+Custom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MainViewController+Custom.h"; sourceTree = ""; }; - DE800B2B22A2F8AF00AC9A23 /* MainViewController+AutoTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MainViewController+AutoTests.m"; sourceTree = ""; }; - DE800B2C22A2F8AF00AC9A23 /* MainViewController+OOB.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MainViewController+OOB.m"; sourceTree = ""; }; - DE800B2D22A2F8AF00AC9A23 /* AppManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppManager.m; sourceTree = ""; }; - DE800B2E22A2F8AF00AC9A23 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - DE800B2F22A2F8AF00AC9A23 /* MainViewController+App.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MainViewController+App.m"; sourceTree = ""; }; - DE800B3022A2F8AF00AC9A23 /* MainViewController+Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MainViewController+Internal.h"; sourceTree = ""; }; - DE800B3122A2F8AF00AC9A23 /* MainViewController+OAuth.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MainViewController+OAuth.m"; sourceTree = ""; }; - DE800B3222A2F8AF00AC9A23 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; - DE800B3322A2F8AF00AC9A23 /* GoogleAuthProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GoogleAuthProvider.h; sourceTree = ""; }; - DE800B3422A2F8AF00AC9A23 /* UserInfoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserInfoViewController.m; sourceTree = ""; }; - DE800B3522A2F8AF00AC9A23 /* SettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsViewController.h; sourceTree = ""; }; - DE800B3622A2F8AF00AC9A23 /* StaticContentTableViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StaticContentTableViewManager.m; sourceTree = ""; }; - DE800B3722A2F8AF00AC9A23 /* MainViewController+Email.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MainViewController+Email.h"; sourceTree = ""; }; - DE800B3822A2F8AF00AC9A23 /* MainViewController+Auth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MainViewController+Auth.h"; sourceTree = ""; }; - DE800B3922A2F8AF00AC9A23 /* MainViewController+Google.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MainViewController+Google.m"; sourceTree = ""; }; - DE800B3A22A2F8AF00AC9A23 /* UIViewController+Alerts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+Alerts.h"; sourceTree = ""; }; - DE800B3B22A2F8AF00AC9A23 /* FacebookAuthProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FacebookAuthProvider.m; sourceTree = ""; }; - DE800B3C22A2F8AF00AC9A23 /* ApplicationDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ApplicationDelegate.m; sourceTree = ""; }; - DE800B3D22A2F8AF00AC9A23 /* CustomTokenDataEntryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomTokenDataEntryViewController.m; sourceTree = ""; }; - DE800B3E22A2F8AF00AC9A23 /* MainViewController+Facebook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MainViewController+Facebook.h"; sourceTree = ""; }; - DE800B3F22A2F8AF00AC9A23 /* MainViewController+Phone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MainViewController+Phone.h"; sourceTree = ""; }; - DE800B4022A2F8AF00AC9A23 /* UserTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserTableViewCell.h; sourceTree = ""; }; - DE800B4122A2F8AF00AC9A23 /* SettingsViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SettingsViewController.xib; sourceTree = ""; }; - DE800B4222A2F8AF00AC9A23 /* MainViewController+GameCenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MainViewController+GameCenter.h"; sourceTree = ""; }; - DE800B4322A2F8AF00AC9A23 /* MainViewController+User.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MainViewController+User.h"; sourceTree = ""; }; - DE800B4422A2F8AF00AC9A23 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = ""; }; - DE800B4522A2F8AF00AC9A23 /* AuthProviders.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AuthProviders.m; sourceTree = ""; }; - DE800B4622A2F8AF00AC9A23 /* AuthCredentialsTemplate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthCredentialsTemplate.h; sourceTree = ""; }; - DE800B6522A2FF7300AC9A23 /* GoogleService-Info_multi.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info_multi.plist"; sourceTree = ""; }; - DE800B6622A2FF7300AC9A23 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; - DE800B6922A2FF8700AC9A23 /* Application.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Application.plist; sourceTree = ""; }; - DE800B6A22A2FF8700AC9A23 /* Sample.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Sample.entitlements; sourceTree = ""; }; - DE800B6C22A2FFFF00AC9A23 /* AuthCredentials.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthCredentials.h; sourceTree = ""; }; - DE800B7122A5927C00AC9A23 /* Auth_ApiTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Auth_ApiTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - DE800B9522A5BD1800AC9A23 /* Auth_E2eTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Auth_E2eTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - DEBEF6032450EA27005E1A8F /* SwiftApiTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwiftApiTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - DEBEF6072450EA27005E1A8F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - DEBEF60D245247A0005E1A8F /* AccountInfoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountInfoTests.swift; sourceTree = ""; }; - DED400A3243E56F500BF6D56 /* AuthCredentials.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthCredentials.h; sourceTree = ""; }; - DED400A4243E56F500BF6D56 /* FacebookAuthTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FacebookAuthTests.m; sourceTree = ""; }; - DED400A5243E56F500BF6D56 /* generate_refresh_token.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = generate_refresh_token.sh; sourceTree = ""; }; - DED400A6243E56F500BF6D56 /* PhoneMultiFactorTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhoneMultiFactorTests.swift; sourceTree = ""; }; - DED400A7243E56F500BF6D56 /* AuthCredentialsTemplate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthCredentialsTemplate.h; sourceTree = ""; }; - DED400A8243E56F500BF6D56 /* AnonymousAuthTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AnonymousAuthTests.m; sourceTree = ""; }; - DED400A9243E56F500BF6D56 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - DED400AA243E56F500BF6D56 /* FIRAuthApiTestsBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FIRAuthApiTestsBase.h; sourceTree = ""; }; - DED400AB243E56F500BF6D56 /* AccountInfoTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AccountInfoTests.m; sourceTree = ""; }; - DED400AC243E56F500BF6D56 /* EmailPasswordAuthTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EmailPasswordAuthTests.m; sourceTree = ""; }; - DED400AD243E56F500BF6D56 /* CustomAuthTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomAuthTests.m; sourceTree = ""; }; - DED400AE243E56F500BF6D56 /* GoogleAuthTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GoogleAuthTests.m; sourceTree = ""; }; - DED400AF243E56F500BF6D56 /* FIRAuthApiTestsBase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FIRAuthApiTestsBase.m; sourceTree = ""; }; - DED400BA243E571500BF6D56 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - DED400BB243E571500BF6D56 /* VerifyIOSClientTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VerifyIOSClientTests.m; sourceTree = ""; }; - DED400BC243E571500BF6D56 /* BYOAuthTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BYOAuthTests.m; sourceTree = ""; }; - DED400BD243E571500BF6D56 /* FIRAuthE2eTestsBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FIRAuthE2eTestsBase.h; sourceTree = ""; }; - DED400BE243E571500BF6D56 /* FIRAuthE2eTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FIRAuthE2eTests.m; sourceTree = ""; }; - DED400BF243E571500BF6D56 /* FIRAuthE2eTestsBase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FIRAuthE2eTestsBase.m; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - DE800AF122A2F87E00AC9A23 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - DE800B6E22A5927C00AC9A23 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - DE800B9222A5BD1800AC9A23 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - DEBEF6002450EA27005E1A8F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - DE800AEB22A2F87E00AC9A23 = { - isa = PBXGroup; - children = ( - DE800B0D22A2F8AF00AC9A23 /* Sample */, - DE800B7222A5927C00AC9A23 /* Auth_ApiTests */, - DE800B9622A5BD1800AC9A23 /* E2eTests */, - DEBEF6042450EA27005E1A8F /* SwiftApiTests */, - DE800AF522A2F87E00AC9A23 /* Products */, - ); - sourceTree = ""; - }; - DE800AF522A2F87E00AC9A23 /* Products */ = { - isa = PBXGroup; - children = ( - DE800AF422A2F87E00AC9A23 /* AuthSample.app */, - DE800B7122A5927C00AC9A23 /* Auth_ApiTests.xctest */, - DE800B9522A5BD1800AC9A23 /* Auth_E2eTests.xctest */, - DEBEF6032450EA27005E1A8F /* SwiftApiTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - DE800B0D22A2F8AF00AC9A23 /* Sample */ = { - isa = PBXGroup; - children = ( - DE800B6922A2FF8700AC9A23 /* Application.plist */, - DE800B1F22A2F8AF00AC9A23 /* ApplicationDelegate.h */, - DE800B3C22A2F8AF00AC9A23 /* ApplicationDelegate.m */, - DE800B2722A2F8AF00AC9A23 /* ApplicationTemplate.plist */, - DE800B0E22A2F8AF00AC9A23 /* AppManager.h */, - DE800B2D22A2F8AF00AC9A23 /* AppManager.m */, - DE800B6C22A2FFFF00AC9A23 /* AuthCredentials.h */, - DE800B4622A2F8AF00AC9A23 /* AuthCredentialsTemplate.h */, - DE800B2622A2F8AF00AC9A23 /* AuthProviders.h */, - DE800B4522A2F8AF00AC9A23 /* AuthProviders.m */, - DE800B1D22A2F8AF00AC9A23 /* CustomTokenDataEntryViewController.h */, - DE800B3D22A2F8AF00AC9A23 /* CustomTokenDataEntryViewController.m */, - DE800B1E22A2F8AF00AC9A23 /* FacebookAuthProvider.h */, - DE800B3B22A2F8AF00AC9A23 /* FacebookAuthProvider.m */, - DE800B3322A2F8AF00AC9A23 /* GoogleAuthProvider.h */, - DE800B1422A2F8AF00AC9A23 /* GoogleAuthProvider.m */, - DE800B6522A2FF7300AC9A23 /* GoogleService-Info_multi.plist */, - DE800B6622A2FF7300AC9A23 /* GoogleService-Info.plist */, - DE800B3222A2F8AF00AC9A23 /* Images.xcassets */, - DE800B2E22A2F8AF00AC9A23 /* main.m */, - DE800B4422A2F8AF00AC9A23 /* MainViewController.h */, - DE800B2922A2F8AF00AC9A23 /* MainViewController.m */, - DE800B1322A2F8AF00AC9A23 /* MainViewController.xib */, - DE800B1722A2F8AF00AC9A23 /* MainViewController+App.h */, - DE800B2F22A2F8AF00AC9A23 /* MainViewController+App.m */, - DE800B3822A2F8AF00AC9A23 /* MainViewController+Auth.h */, - DE800B2322A2F8AF00AC9A23 /* MainViewController+Auth.m */, - DE800B0F22A2F8AF00AC9A23 /* MainViewController+AutoTests.h */, - DE800B2B22A2F8AF00AC9A23 /* MainViewController+AutoTests.m */, - DE800B2A22A2F8AF00AC9A23 /* MainViewController+Custom.h */, - DE800B1122A2F8AF00AC9A23 /* MainViewController+Custom.m */, - DE800B3722A2F8AF00AC9A23 /* MainViewController+Email.h */, - DE800B2222A2F8AF00AC9A23 /* MainViewController+Email.m */, - DE800B3E22A2F8AF00AC9A23 /* MainViewController+Facebook.h */, - DE800B1C22A2F8AF00AC9A23 /* MainViewController+Facebook.m */, - DE800B4222A2F8AF00AC9A23 /* MainViewController+GameCenter.h */, - DE800B1922A2F8AF00AC9A23 /* MainViewController+GameCenter.m */, - DE800B2122A2F8AF00AC9A23 /* MainViewController+Google.h */, - DE800B3922A2F8AF00AC9A23 /* MainViewController+Google.m */, - DE800B3022A2F8AF00AC9A23 /* MainViewController+Internal.h */, - 400283E823EA254A0006A298 /* MainViewController+MultiFactor.h */, - 400283E923EA254A0006A298 /* MainViewController+MultiFactor.m */, - DE800B1622A2F8AF00AC9A23 /* MainViewController+OAuth.h */, - DE800B3122A2F8AF00AC9A23 /* MainViewController+OAuth.m */, - DE800B1022A2F8AF00AC9A23 /* MainViewController+OOB.h */, - DE800B2C22A2F8AF00AC9A23 /* MainViewController+OOB.m */, - DE800B3F22A2F8AF00AC9A23 /* MainViewController+Phone.h */, - DE800B1A22A2F8AF00AC9A23 /* MainViewController+Phone.m */, - DE800B4322A2F8AF00AC9A23 /* MainViewController+User.h */, - DE800B1822A2F8AF00AC9A23 /* MainViewController+User.m */, - DE800B6A22A2FF8700AC9A23 /* Sample.entitlements */, - DE800B2522A2F8AF00AC9A23 /* SampleTemplate.entitlements */, - DE800B3522A2F8AF00AC9A23 /* SettingsViewController.h */, - DE800B1222A2F8AF00AC9A23 /* SettingsViewController.m */, - DE800B4122A2F8AF00AC9A23 /* SettingsViewController.xib */, - DE800B2422A2F8AF00AC9A23 /* StaticContentTableViewManager.h */, - DE800B3622A2F8AF00AC9A23 /* StaticContentTableViewManager.m */, - DE800B3A22A2F8AF00AC9A23 /* UIViewController+Alerts.h */, - DE800B2022A2F8AF00AC9A23 /* UIViewController+Alerts.m */, - DE800B1522A2F8AF00AC9A23 /* UserInfoViewController.h */, - DE800B3422A2F8AF00AC9A23 /* UserInfoViewController.m */, - DE800B2822A2F8AF00AC9A23 /* UserInfoViewController.xib */, - DE800B4022A2F8AF00AC9A23 /* UserTableViewCell.h */, - DE800B1B22A2F8AF00AC9A23 /* UserTableViewCell.m */, - ); - path = Sample; - sourceTree = SOURCE_ROOT; - }; - DE800B7222A5927C00AC9A23 /* Auth_ApiTests */ = { - isa = PBXGroup; - children = ( - DED400AB243E56F500BF6D56 /* AccountInfoTests.m */, - DED400A8243E56F500BF6D56 /* AnonymousAuthTests.m */, - DED400A3243E56F500BF6D56 /* AuthCredentials.h */, - DED400A7243E56F500BF6D56 /* AuthCredentialsTemplate.h */, - DED400AD243E56F500BF6D56 /* CustomAuthTests.m */, - DED400AC243E56F500BF6D56 /* EmailPasswordAuthTests.m */, - DED400A4243E56F500BF6D56 /* FacebookAuthTests.m */, - DED400AA243E56F500BF6D56 /* FIRAuthApiTestsBase.h */, - DED400AF243E56F500BF6D56 /* FIRAuthApiTestsBase.m */, - DED400A5243E56F500BF6D56 /* generate_refresh_token.sh */, - DED400AE243E56F500BF6D56 /* GoogleAuthTests.m */, - DED400A9243E56F500BF6D56 /* Info.plist */, - DED400A6243E56F500BF6D56 /* PhoneMultiFactorTests.swift */, - ); - name = Auth_ApiTests; - path = ApiTests; - sourceTree = SOURCE_ROOT; - }; - DE800B9622A5BD1800AC9A23 /* E2eTests */ = { - isa = PBXGroup; - children = ( - DED400BC243E571500BF6D56 /* BYOAuthTests.m */, - DED400BE243E571500BF6D56 /* FIRAuthE2eTests.m */, - DED400BD243E571500BF6D56 /* FIRAuthE2eTestsBase.h */, - DED400BF243E571500BF6D56 /* FIRAuthE2eTestsBase.m */, - DED400BA243E571500BF6D56 /* Info.plist */, - DED400BB243E571500BF6D56 /* VerifyIOSClientTests.m */, - ); - path = E2eTests; - sourceTree = SOURCE_ROOT; - }; - DEBEF6042450EA27005E1A8F /* SwiftApiTests */ = { - isa = PBXGroup; - children = ( - DEBEF6072450EA27005E1A8F /* Info.plist */, - DEBEF60D245247A0005E1A8F /* AccountInfoTests.swift */, - DE1865AB245B879B00F8AD70 /* TestsBase.swift */, - DE1865AD245B8A1400F8AD70 /* AnonymousTests.swift */, - DE1865B1245C7A2B00F8AD70 /* EmailPasswordTests.swift */, - DE1865B3245C92A600F8AD70 /* GoogleTests.swift */, - DE1865B5245C95DA00F8AD70 /* Credentials.swift */, - DE1865B7245CC6FC00F8AD70 /* FacebookTests.swift */, - ); - path = SwiftApiTests; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - DE800AF322A2F87E00AC9A23 /* AuthSample */ = { - isa = PBXNativeTarget; - buildConfigurationList = DE800B0A22A2F88000AC9A23 /* Build configuration list for PBXNativeTarget "AuthSample" */; - buildPhases = ( - DE800AF022A2F87E00AC9A23 /* Sources */, - DE800AF122A2F87E00AC9A23 /* Frameworks */, - DE800AF222A2F87E00AC9A23 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = AuthSample; - productName = AuthSample; - productReference = DE800AF422A2F87E00AC9A23 /* AuthSample.app */; - productType = "com.apple.product-type.application"; - }; - DE800B7022A5927C00AC9A23 /* Auth_ApiTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = DE800B7A22A5927C00AC9A23 /* Build configuration list for PBXNativeTarget "Auth_ApiTests" */; - buildPhases = ( - DE800B6D22A5927C00AC9A23 /* Sources */, - DE800B6E22A5927C00AC9A23 /* Frameworks */, - DE800B6F22A5927C00AC9A23 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - DE800B7722A5927C00AC9A23 /* PBXTargetDependency */, - ); - name = Auth_ApiTests; - productName = Auth_ApiTests; - productReference = DE800B7122A5927C00AC9A23 /* Auth_ApiTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - DE800B9422A5BD1800AC9A23 /* Auth_E2eTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = DE800B9C22A5BD1800AC9A23 /* Build configuration list for PBXNativeTarget "Auth_E2eTests" */; - buildPhases = ( - DE800B9122A5BD1800AC9A23 /* Sources */, - DE800B9222A5BD1800AC9A23 /* Frameworks */, - DE800B9322A5BD1800AC9A23 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - DE800B9B22A5BD1800AC9A23 /* PBXTargetDependency */, - ); - name = Auth_E2eTests; - productName = Auth_E2eTests; - productReference = DE800B9522A5BD1800AC9A23 /* Auth_E2eTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - DEBEF6022450EA27005E1A8F /* SwiftApiTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = DEBEF60A2450EA27005E1A8F /* Build configuration list for PBXNativeTarget "SwiftApiTests" */; - buildPhases = ( - DEBEF5FF2450EA27005E1A8F /* Sources */, - DEBEF6002450EA27005E1A8F /* Frameworks */, - DEBEF6012450EA27005E1A8F /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - DEBEF6092450EA27005E1A8F /* PBXTargetDependency */, - ); - name = SwiftApiTests; - productName = SwiftApiTests; - productReference = DEBEF6032450EA27005E1A8F /* SwiftApiTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - DE800AEC22A2F87E00AC9A23 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 1140; - LastUpgradeCheck = 1020; - ORGANIZATIONNAME = Firebase; - TargetAttributes = { - DE800AF322A2F87E00AC9A23 = { - CreatedOnToolsVersion = 10.2; - LastSwiftMigration = 1140; - }; - DE800B7022A5927C00AC9A23 = { - CreatedOnToolsVersion = 10.2; - LastSwiftMigration = 1020; - TestTargetID = DE800AF322A2F87E00AC9A23; - }; - DE800B9422A5BD1800AC9A23 = { - CreatedOnToolsVersion = 10.2; - TestTargetID = DE800AF322A2F87E00AC9A23; - }; - DEBEF6022450EA27005E1A8F = { - CreatedOnToolsVersion = 11.4.1; - TestTargetID = DE800AF322A2F87E00AC9A23; - }; - }; - }; - buildConfigurationList = DE800AEF22A2F87E00AC9A23 /* Build configuration list for PBXProject "AuthSample" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = DE800AEB22A2F87E00AC9A23; - productRefGroup = DE800AF522A2F87E00AC9A23 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - DE800AF322A2F87E00AC9A23 /* AuthSample */, - DE800B7022A5927C00AC9A23 /* Auth_ApiTests */, - DE800B9422A5BD1800AC9A23 /* Auth_E2eTests */, - DEBEF6022450EA27005E1A8F /* SwiftApiTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - DE800AF222A2F87E00AC9A23 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - DE800B5422A2F8AF00AC9A23 /* UserInfoViewController.xib in Resources */, - DE800B5C22A2F8AF00AC9A23 /* Images.xcassets in Resources */, - DE800B4922A2F8AF00AC9A23 /* MainViewController.xib in Resources */, - DE800B6722A2FF7300AC9A23 /* GoogleService-Info_multi.plist in Resources */, - DE800B6322A2F8AF00AC9A23 /* SettingsViewController.xib in Resources */, - DE800B6822A2FF7300AC9A23 /* GoogleService-Info.plist in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - DE800B6F22A5927C00AC9A23 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - DED400B1243E56F500BF6D56 /* generate_refresh_token.sh in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - DE800B9322A5BD1800AC9A23 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - DEBEF6012450EA27005E1A8F /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - DE800AF022A2F87E00AC9A23 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - DE800B5722A2F8AF00AC9A23 /* MainViewController+OOB.m in Sources */, - DE800B4E22A2F8AF00AC9A23 /* UserTableViewCell.m in Sources */, - DE800B6422A2F8AF00AC9A23 /* AuthProviders.m in Sources */, - DE800B4F22A2F8AF00AC9A23 /* MainViewController+Facebook.m in Sources */, - DE800B4D22A2F8AF00AC9A23 /* MainViewController+Phone.m in Sources */, - DE800B4722A2F8AF00AC9A23 /* MainViewController+Custom.m in Sources */, - 400283EA23EA254B0006A298 /* MainViewController+MultiFactor.m in Sources */, - DE800B5A22A2F8AF00AC9A23 /* MainViewController+App.m in Sources */, - DE800B6222A2F8AF00AC9A23 /* CustomTokenDataEntryViewController.m in Sources */, - DE800B6122A2F8AF00AC9A23 /* ApplicationDelegate.m in Sources */, - DE800B4A22A2F8AF00AC9A23 /* GoogleAuthProvider.m in Sources */, - DE800B5B22A2F8AF00AC9A23 /* MainViewController+OAuth.m in Sources */, - DE800B6022A2F8AF00AC9A23 /* FacebookAuthProvider.m in Sources */, - DE800B5922A2F8AF00AC9A23 /* main.m in Sources */, - DE800B5222A2F8AF00AC9A23 /* MainViewController+Auth.m in Sources */, - DE800B5F22A2F8AF00AC9A23 /* MainViewController+Google.m in Sources */, - DE800B5D22A2F8AF00AC9A23 /* UserInfoViewController.m in Sources */, - DE800B4B22A2F8AF00AC9A23 /* MainViewController+User.m in Sources */, - DE800B5522A2F8AF00AC9A23 /* MainViewController.m in Sources */, - DE800B5122A2F8AF00AC9A23 /* MainViewController+Email.m in Sources */, - DE800B5022A2F8AF00AC9A23 /* UIViewController+Alerts.m in Sources */, - DE800B5E22A2F8AF00AC9A23 /* StaticContentTableViewManager.m in Sources */, - DE800B4C22A2F8AF00AC9A23 /* MainViewController+GameCenter.m in Sources */, - DE800B4822A2F8AF00AC9A23 /* SettingsViewController.m in Sources */, - DE800B5622A2F8AF00AC9A23 /* MainViewController+AutoTests.m in Sources */, - DE800B5822A2F8AF00AC9A23 /* AppManager.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - DE800B6D22A5927C00AC9A23 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - DED400B0243E56F500BF6D56 /* FacebookAuthTests.m in Sources */, - DED400B5243E56F500BF6D56 /* AccountInfoTests.m in Sources */, - DED400B6243E56F500BF6D56 /* EmailPasswordAuthTests.m in Sources */, - DED400B9243E56F500BF6D56 /* FIRAuthApiTestsBase.m in Sources */, - DED400B3243E56F500BF6D56 /* AnonymousAuthTests.m in Sources */, - DED400B7243E56F500BF6D56 /* CustomAuthTests.m in Sources */, - DED400B8243E56F500BF6D56 /* GoogleAuthTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - DE800B9122A5BD1800AC9A23 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - DED400C2243E571500BF6D56 /* BYOAuthTests.m in Sources */, - DED400C4243E571500BF6D56 /* FIRAuthE2eTestsBase.m in Sources */, - DED400C1243E571500BF6D56 /* VerifyIOSClientTests.m in Sources */, - DED400C3243E571500BF6D56 /* FIRAuthE2eTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - DEBEF5FF2450EA27005E1A8F /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - DE1865B4245C92A600F8AD70 /* GoogleTests.swift in Sources */, - DE1865AE245B8A1400F8AD70 /* AnonymousTests.swift in Sources */, - DE1865B8245CC6FC00F8AD70 /* FacebookTests.swift in Sources */, - DE1865B6245C95DA00F8AD70 /* Credentials.swift in Sources */, - DE1865B2245C7A2B00F8AD70 /* EmailPasswordTests.swift in Sources */, - DE1865AC245B879B00F8AD70 /* TestsBase.swift in Sources */, - DEBEF60E245247A0005E1A8F /* AccountInfoTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - DE800B7722A5927C00AC9A23 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = DE800AF322A2F87E00AC9A23 /* AuthSample */; - targetProxy = DE800B7622A5927C00AC9A23 /* PBXContainerItemProxy */; - }; - DE800B9B22A5BD1800AC9A23 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = DE800AF322A2F87E00AC9A23 /* AuthSample */; - targetProxy = DE800B9A22A5BD1800AC9A23 /* PBXContainerItemProxy */; - }; - DEBEF6092450EA27005E1A8F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = DE800AF322A2F87E00AC9A23 /* AuthSample */; - targetProxy = DEBEF6082450EA27005E1A8F /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - DE800B0822A2F88000AC9A23 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - }; - name = Debug; - }; - DE800B0922A2F88000AC9A23 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - DE800B0B22A2F88000AC9A23 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Sample/Sample.entitlements; - CODE_SIGN_STYLE = Automatic; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - "${SRCROOT}/../../..", - ); - INFOPLIST_FILE = Sample/Application.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.google.FirebaseExperimental1; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - DE800B0C22A2F88000AC9A23 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Sample/Sample.entitlements; - CODE_SIGN_STYLE = Automatic; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - "${SRCROOT}/../../..", - ); - INFOPLIST_FILE = Sample/Application.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.google.FirebaseExperimental1; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - DE800B7822A5927C00AC9A23 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_STYLE = Automatic; - INFOPLIST_FILE = ApiTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = "com.google.firebase.auth.Auth-ApiTests"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "../ApiTests/Auth_ApiTests-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AuthSample.app/AuthSample"; - }; - name = Debug; - }; - DE800B7922A5927C00AC9A23 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_STYLE = Automatic; - INFOPLIST_FILE = ApiTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = "com.google.firebase.auth.Auth-ApiTests"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "../ApiTests/Auth_ApiTests-Bridging-Header.h"; - SWIFT_VERSION = 4.2; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AuthSample.app/AuthSample"; - }; - name = Release; - }; - DE800B9D22A5BD1800AC9A23 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - INFOPLIST_FILE = E2eTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = "com.google.firebase.auth.Auth-E2eTests"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AuthSample.app/AuthSample"; - }; - name = Debug; - }; - DE800B9E22A5BD1800AC9A23 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - INFOPLIST_FILE = E2eTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = "com.google.firebase.auth.Auth-E2eTests"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AuthSample.app/AuthSample"; - }; - name = Release; - }; - DEBEF60B2450EA27005E1A8F /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - INFOPLIST_FILE = SwiftApiTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.SwiftApiTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AuthSample.app/AuthSample"; - }; - name = Debug; - }; - DEBEF60C2450EA27005E1A8F /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - INFOPLIST_FILE = SwiftApiTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.SwiftApiTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AuthSample.app/AuthSample"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - DE800AEF22A2F87E00AC9A23 /* Build configuration list for PBXProject "AuthSample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - DE800B0822A2F88000AC9A23 /* Debug */, - DE800B0922A2F88000AC9A23 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - DE800B0A22A2F88000AC9A23 /* Build configuration list for PBXNativeTarget "AuthSample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - DE800B0B22A2F88000AC9A23 /* Debug */, - DE800B0C22A2F88000AC9A23 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - DE800B7A22A5927C00AC9A23 /* Build configuration list for PBXNativeTarget "Auth_ApiTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - DE800B7822A5927C00AC9A23 /* Debug */, - DE800B7922A5927C00AC9A23 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - DE800B9C22A5BD1800AC9A23 /* Build configuration list for PBXNativeTarget "Auth_E2eTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - DE800B9D22A5BD1800AC9A23 /* Debug */, - DE800B9E22A5BD1800AC9A23 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - DEBEF60A2450EA27005E1A8F /* Build configuration list for PBXNativeTarget "SwiftApiTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - DEBEF60B2450EA27005E1A8F /* Debug */, - DEBEF60C2450EA27005E1A8F /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = DE800AEC22A2F87E00AC9A23 /* Project object */; -} diff --git a/FirebaseAuth/Tests/Sample/AuthSample.xcodeproj/xcshareddata/xcschemes/AuthSample.xcscheme b/FirebaseAuth/Tests/Sample/AuthSample.xcodeproj/xcshareddata/xcschemes/AuthSample.xcscheme deleted file mode 100644 index adb5894e740..00000000000 --- a/FirebaseAuth/Tests/Sample/AuthSample.xcodeproj/xcshareddata/xcschemes/AuthSample.xcscheme +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/FirebaseAuth/Tests/Sample/AuthSample.xcodeproj/xcshareddata/xcschemes/Auth_ApiTests.xcscheme b/FirebaseAuth/Tests/Sample/AuthSample.xcodeproj/xcshareddata/xcschemes/Auth_ApiTests.xcscheme deleted file mode 100644 index 0579a0247ed..00000000000 --- a/FirebaseAuth/Tests/Sample/AuthSample.xcodeproj/xcshareddata/xcschemes/Auth_ApiTests.xcscheme +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/FirebaseAuth/Tests/Sample/AuthSample.xcodeproj/xcshareddata/xcschemes/Auth_E2eTests.xcscheme b/FirebaseAuth/Tests/Sample/AuthSample.xcodeproj/xcshareddata/xcschemes/Auth_E2eTests.xcscheme deleted file mode 100644 index 8a72476098b..00000000000 --- a/FirebaseAuth/Tests/Sample/AuthSample.xcodeproj/xcshareddata/xcschemes/Auth_E2eTests.xcscheme +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/FirebaseAuth/Tests/Sample/AuthSample.xcodeproj/xcshareddata/xcschemes/SwiftApiTests.xcscheme b/FirebaseAuth/Tests/Sample/AuthSample.xcodeproj/xcshareddata/xcschemes/SwiftApiTests.xcscheme deleted file mode 100644 index 5bbc32956aa..00000000000 --- a/FirebaseAuth/Tests/Sample/AuthSample.xcodeproj/xcshareddata/xcschemes/SwiftApiTests.xcscheme +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/FirebaseAuth/Tests/Sample/E2eTests/BYOAuthTests.m b/FirebaseAuth/Tests/Sample/E2eTests/BYOAuthTests.m deleted file mode 100644 index dbe71266b81..00000000000 --- a/FirebaseAuth/Tests/Sample/E2eTests/BYOAuthTests.m +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "FIRAuthE2eTestsBase.h" - -/** The url for obtaining a valid custom token string used to test BYOAuth. */ -static NSString *const kCustomTokenUrl = @"https://gcip-testapps.wl.r.appspot.com/token"; - -/** The invalid custom token string for testing BYOAuth. */ -static NSString *const kInvalidCustomToken = @"invalid token."; - -/** The user name string for BYOAuth testing account. */ -static NSString *const kTestingAccountUserID = @"BYU_Test_User_ID"; - -@interface BYOAuthTests : FIRAuthE2eTestsBase - -@end - -@implementation BYOAuthTests - -/** Test sign in with a valid BYOAuth token retrived from a remote server. */ -- (void)testSignInWithValidBYOAuthToken { - NSError *error; - NSString *customToken = [NSString stringWithContentsOfURL:[NSURL URLWithString:kCustomTokenUrl] - encoding:NSUTF8StringEncoding - error:&error]; - if (!customToken) { - GREYFail(@"There was an error retrieving the custom token: %@", error); - } - - [[[EarlGrey selectElementWithMatcher:grey_allOf(grey_text(@"Sign In (BYOAuth)"), - grey_sufficientlyVisible(), nil)] - usingSearchAction:grey_scrollInDirection(kGREYDirectionDown, kShortScrollDistance) - onElementWithMatcher:grey_allOf(grey_scrollView(), grey_kindOfClass([UITableView class]), - nil)] performAction:grey_tap()]; - - [[[EarlGrey selectElementWithMatcher:grey_kindOfClass([UITextView class])] - performAction:grey_replaceText(customToken)] assertWithMatcher:grey_text(customToken)]; - - [[EarlGrey selectElementWithMatcher:grey_text(@"Done")] performAction:grey_tap()]; - - [self waitForElementWithText:@"OK" withDelay:kWaitForElementTimeOut]; - - [[EarlGrey selectElementWithMatcher:grey_text(@"OK")] performAction:grey_tap()]; - - [[[EarlGrey selectElementWithMatcher:grey_allOf(grey_text(kTestingAccountUserID), - grey_sufficientlyVisible(), nil)] - usingSearchAction:grey_scrollInDirection(kGREYDirectionUp, kShortScrollDistance) - onElementWithMatcher:grey_allOf(grey_scrollView(), grey_kindOfClass([UITableView class]), - nil)] assertWithMatcher:grey_sufficientlyVisible()]; -} - -- (void)testSignInWithInvalidBYOAuthToken { - [[[EarlGrey selectElementWithMatcher:grey_allOf(grey_text(@"Sign In (BYOAuth)"), - grey_sufficientlyVisible(), nil)] - usingSearchAction:grey_scrollInDirection(kGREYDirectionDown, kShortScrollDistance) - onElementWithMatcher:grey_allOf(grey_scrollView(), grey_kindOfClass([UITableView class]), - nil)] performAction:grey_tap()]; - - [[[EarlGrey selectElementWithMatcher:grey_kindOfClass([UITextView class])] - performAction:grey_replaceText(kInvalidCustomToken)] - assertWithMatcher:grey_text(kInvalidCustomToken)]; - - [[EarlGrey selectElementWithMatcher:grey_text(@"Done")] performAction:grey_tap()]; - - NSString *invalidTokenErrorMessage = @"Sign-In Error"; - - [self waitForElementWithText:invalidTokenErrorMessage withDelay:kWaitForElementTimeOut]; - - [[EarlGrey selectElementWithMatcher:grey_text(@"OK")] performAction:grey_tap()]; -} - -@end diff --git a/FirebaseAuth/Tests/Sample/E2eTests/FIRAuthE2eTests.m b/FirebaseAuth/Tests/Sample/E2eTests/FIRAuthE2eTests.m deleted file mode 100644 index 50512f53699..00000000000 --- a/FirebaseAuth/Tests/Sample/E2eTests/FIRAuthE2eTests.m +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2017 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "FIRAuthE2eTestsBase.h" - -@interface FIRAuthE2eTests : FIRAuthE2eTestsBase - -@end - -@implementation FIRAuthE2eTests - -- (void)testSignInExistingUser { - NSString *email = @"123@abc.com"; - [[[EarlGrey selectElementWithMatcher:grey_allOf(grey_text(@"Sign in with Email/Password"), - grey_sufficientlyVisible(), nil)] - usingSearchAction:grey_scrollInDirection(kGREYDirectionDown, kShortScrollDistance) - onElementWithMatcher:grey_allOf(grey_scrollView(), grey_kindOfClass([UITableView class]), - nil)] performAction:grey_tap()]; - - id comfirmationButtonMatcher = - grey_allOf(grey_kindOfClass([UILabel class]), grey_accessibilityLabel(@"OK"), nil); - - [[EarlGrey selectElementWithMatcher: - // TODO: Add accessibilityIdentifiers for the elements. - grey_kindOfClass(NSClassFromString(@"_UIAlertControllerView"))] - performAction:grey_typeText(email)]; - - [[EarlGrey selectElementWithMatcher:comfirmationButtonMatcher] performAction:grey_tap()]; - - [[EarlGrey - selectElementWithMatcher:grey_kindOfClass(NSClassFromString(@"_UIAlertControllerView"))] - performAction:grey_typeText(@"password")]; - - [[EarlGrey selectElementWithMatcher:comfirmationButtonMatcher] performAction:grey_tap()]; - - [[[EarlGrey - selectElementWithMatcher:grey_allOf(grey_text(email), grey_sufficientlyVisible(), nil)] - usingSearchAction:grey_scrollInDirection(kGREYDirectionUp, kShortScrollDistance) - onElementWithMatcher:grey_allOf(grey_scrollView(), grey_kindOfClass([UITableView class]), - nil)] assertWithMatcher:grey_sufficientlyVisible()]; -} - -@end diff --git a/FirebaseAuth/Tests/Sample/E2eTests/FIRAuthE2eTestsBase.h b/FirebaseAuth/Tests/Sample/E2eTests/FIRAuthE2eTestsBase.h deleted file mode 100644 index 5c25b0d1194..00000000000 --- a/FirebaseAuth/Tests/Sample/E2eTests/FIRAuthE2eTestsBase.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#import - -#import - -NS_ASSUME_NONNULL_BEGIN - -extern CGFloat const kShortScrollDistance; - -extern NSTimeInterval const kWaitForElementTimeOut; - -/** Convenience function for EarlGrey tests. */ -id grey_scrollView(void); - -@interface FIRAuthE2eTestsBase : XCTestCase - -/** Sign out current account. */ -- (void)signOut; - -/** Wait for an element with text to appear. */ -- (void)waitForElementWithText:(NSString *)text withDelay:(NSTimeInterval)maxDelay; - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/E2eTests/FIRAuthE2eTestsBase.m b/FirebaseAuth/Tests/Sample/E2eTests/FIRAuthE2eTestsBase.m deleted file mode 100644 index 08fc7be79f8..00000000000 --- a/FirebaseAuth/Tests/Sample/E2eTests/FIRAuthE2eTestsBase.m +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "FIRAuthE2eTestsBase.h" - -CGFloat const kShortScrollDistance = 400; - -NSTimeInterval const kWaitForElementTimeOut = 15; - -/** Convenience function for EarlGrey tests. */ -id grey_scrollView(void) { - return [GREYMatchers matcherForKindOfClass:[UIScrollView class]]; -} - -@implementation FIRAuthE2eTestsBase - -/** To reset the app so that each test sees the app in a clean state. */ -- (void)setUp { - [super setUp]; - - [self signOut]; - - [[EarlGrey selectElementWithMatcher:grey_allOf(grey_scrollView(), - grey_kindOfClass([UITableView class]), nil)] - performAction:grey_scrollToContentEdge(kGREYContentEdgeTop)]; -} - -- (void)tearDown { - [super tearDown]; -} - -/** Sign out current account. */ -- (void)signOut { - NSError *signOutError; - BOOL status = [[FIRAuth auth] signOut:&signOutError]; - - // Just log the error because we don't want to fail the test if signing out fails. - if (!status) { - NSLog(@"Error signing out: %@", signOutError); - } -} - -/** Wait for an element with text to appear. */ -- (void)waitForElementWithText:(NSString *)text withDelay:(NSTimeInterval)maxDelay { - GREYCondition *displayed = - [GREYCondition conditionWithName:@"Wait for element" - block:^BOOL { - NSError *error = nil; - [[EarlGrey selectElementWithMatcher:grey_text(text)] - assertWithMatcher:grey_sufficientlyVisible() - error:&error]; - return !error; - }]; - GREYAssertTrue([displayed waitWithTimeout:maxDelay], @"Failed to wait for element '%@'.", text); -} - -@end diff --git a/FirebaseAuth/Tests/Sample/E2eTests/Info.plist b/FirebaseAuth/Tests/Sample/E2eTests/Info.plist deleted file mode 100644 index 6c6c23c43ad..00000000000 --- a/FirebaseAuth/Tests/Sample/E2eTests/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/FirebaseAuth/Tests/Sample/E2eTests/VerifyIOSClientTests.m b/FirebaseAuth/Tests/Sample/E2eTests/VerifyIOSClientTests.m deleted file mode 100644 index 131a56430de..00000000000 --- a/FirebaseAuth/Tests/Sample/E2eTests/VerifyIOSClientTests.m +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "FIRAuthE2eTestsBase.h" - -@interface VerifyIOSClientTests : FIRAuthE2eTestsBase - -@end - -@implementation VerifyIOSClientTests - -/** Test verify ios client*/ -- (void)testVerifyIOSClient { - [[[EarlGrey selectElementWithMatcher:grey_allOf(grey_text(@"Verify iOS client"), - grey_sufficientlyVisible(), nil)] - usingSearchAction:grey_scrollInDirection(kGREYDirectionDown, kShortScrollDistance) - onElementWithMatcher:grey_allOf(grey_scrollView(), grey_kindOfClass([UITableView class]), - nil)] performAction:grey_tap()]; - - [self waitForElementWithText:@"OK" withDelay:kWaitForElementTimeOut]; - - [[EarlGrey selectElementWithMatcher:grey_text(@"OK")] performAction:grey_tap()]; -} - -@end diff --git a/FirebaseAuth/Tests/Sample/Podfile b/FirebaseAuth/Tests/Sample/Podfile deleted file mode 100644 index 75c10d0b260..00000000000 --- a/FirebaseAuth/Tests/Sample/Podfile +++ /dev/null @@ -1,36 +0,0 @@ -# Uncomment the next two lines for pre-release testing on internal repo -#source 'sso://cpdc-internal/firebase' -#source 'https://cdn.cocoapods.org/' - -source 'https://github.com/firebase/SpecsDev.git' -source 'https://github.com/firebase/SpecsStaging.git' -source 'https://cdn.cocoapods.org/' - -use_frameworks! - -target 'AuthSample' do - platform :ios, '13.0' - pod 'FirebaseAppCheckInterop', :path => '../../../' - pod 'FirebaseCore', :path => '../../../' - pod 'FirebaseCoreInternal', :path => '../../../' - pod 'FirebaseCoreExtension', :path => '../../../' - pod 'FirebaseAuth', :path => '../../../', :testspecs => ['unit'] - pod 'FirebaseInstallations', :path => '../../..' - pod 'FBSDKLoginKit', '< 13' - pod 'GoogleSignIn', '~> 6' - pod 'GTMSessionFetcher/Core' - pod 'RecaptchaEnterprise', '~> 18.3' - - target 'Auth_ApiTests' do - inherit! :search_paths - end - - target 'SwiftApiTests' do - inherit! :search_paths - end - - target 'Auth_E2eTests' do - inherit! :search_paths - pod 'EarlGrey' - end -end diff --git a/FirebaseAuth/Tests/Sample/README.md b/FirebaseAuth/Tests/Sample/README.md deleted file mode 100644 index 808f1567629..00000000000 --- a/FirebaseAuth/Tests/Sample/README.md +++ /dev/null @@ -1,90 +0,0 @@ -### Running Sample Application - -In order to run this application, you'll need to follow the following steps! - -#### GoogleService-Info.plist files - -You'll need valid `GoogleService-Info.plist` files for those samples. To get your own -`GoogleService-Info.plist` files: -1. Go to the [Firebase Console](https://console.firebase.google.com/) -2. Create a new Firebase project, if you don't already have one -3. For each sample app you want to test, create a new Firebase app with the sample app's bundle -identifier (e.g. `com.google.FirebaseExperimental1.dev`) -4. Download the resulting `GoogleService-Info.plist` and place it in the -[`Sample/` directory](Sample/) - -#### GoogleService-Info\_multi.plist files - -1. Create a second sample app and download its `GoogleService_Info.plist` file. This can be in the -same Firebase project as the one above, or a different one. Use a different app bundle identifier -(e.g. `com.google.FirebaseExperimental2.dev`). -2. Save this plist file as `GoogleService-Info_multi.plist` in -the [`Sample/` directory](Sample/). -This enables testing that FirebaseAuth continues to work after switching the Firebase App in the -runtime. - -#### Getting your own Credential files - -Please follow the instructions in -[Sample/AuthCredentialsTemplate.h](Sample/AuthCredentialsTemplate.h) -to generate the AuthCredentials.h file. - -#### Application.plist file - -Generate the `Sample/Application.plist` file from -[Sample/ApplicationTemplate.plist](Sample/ApplicationTemplate.plist) by replacing `$BUNDLE_ID` and -`$REVERSED_CLIENT_ID` with their values from `GoogleService-Info.plist` and -`$REVERSED_CLIENT_MULTI_ID` with its value from `GoogleService-Info_multi.plist`. - -This could be done in bash via something like this from within the `Sample` directory: -```bash -$ BUNDLE_ID=`xmllint --xpath "/plist/dict/key[.='BUNDLE_ID']/following-sibling::string[1]/text()" GoogleService-Info.plist` -$ REVERSED_CLIENT_ID=`xmllint --xpath "/plist/dict/key[.='REVERSED_CLIENT_ID']/following-sibling::string[1]/text()" GoogleService-Info.plist` -$ REVERSED_CLIENT_MULTI_ID=`xmllint --xpath "/plist/dict/key[.='REVERSED_CLIENT_ID']/following-sibling::string[1]/text()" GoogleService-Info_multi.plist` -$ sed \ - -e 's/\$BUNDLE_ID/'$BUNDLE_ID'/g' \ - -e 's/\$REVERSED_CLIENT_ID/'$REVERSED_CLIENT_ID'/g' \ - -e 's/\$REVERSED_CLIENT_MULTI_ID/'$REVERSED_CLIENT_MULTI_ID'/g' \ - ApplicationTemplate.plist > Application.plist -``` - -#### Sample.entitlements file - -In order to test the "Reset Password In App" feature you will need to create a dynamic link for your -Firebase project in the Dynamic Links section of the Firebase Console. Once the link is created, -please copy the contents of -[Sample/SampleTemplate.entitlements](Sample/SampleTemplate.entitlements) -into a file named `Sample/Sample.entitlements` and replace `$KAPP_LINKS_DOMAIN` with your own -relevant appLinks domain. Your appLinks domains are domains that your app will handle as universal -links, in this particular case you can obtain this domain from the aforementioned Dynamic Links -section of the Firebase Console. - -### Running API tests - -In order to run the API tests, you'll need to follow the following steps! - -#### Getting your own Credential files - -Please follow the instructions in -[ApiTests/AuthCredentialsTemplate.h](ApiTests/AuthCredentialsTemplate.h) -to generate the AuthCredentials.h file. - -#### Console - -In the Firebase conosle for your test project, you'll need to enable the -following auth providers: -* Email/Password -* Google -* Facebook -* Anonymous - -You'll also need to create a user with email -`user+email_existing_user@example.com` and password of `password`. - -## Usage - -``` -$ pod update -$ open Firebase.xcworkspace -``` -Then select an Auth scheme and run. diff --git a/FirebaseAuth/Tests/Sample/Sample/AppManager.h b/FirebaseAuth/Tests/Sample/Sample/AppManager.h deleted file mode 100644 index c1b0cab0fe6..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/AppManager.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -@class FIRApp; -@class FIRAuth; -@class FIROptions; -@class FIRPhoneAuthProvider; - -NS_ASSUME_NONNULL_BEGIN - -/** @class AppManager - @brief A manager of global FIRApp instances. - */ -@interface AppManager : NSObject - -/** @property count - @brief The total count of apps under management, including the default app. - */ -@property(nonatomic, assign, readonly) int count; - -/** @property active - @brief The index of the currently active app, 0 being the default app. - */ -@property(nonatomic, assign) int active; - -/** @fn appAtIndex: - @brief Retrieves the app at the given index. - @param index The index of the app to be retrieved, 0 being the default app. - @return The app at the given index. - */ -- (nullable FIRApp *)appAtIndex:(int)index; - -/** @fn recreateAppAtIndex:withOptions:completion: - @brief Deletes the app at the given index, and optionally creates it again with given options. - @param index The index of the app to be recreated, 0 being the default app. - @param options Optionally, the new options with which app should be created. - @param completion The block to call when completes. - */ -- (void)recreateAppAtIndex:(int)index - withOptions:(nullable FIROptions *)options - completion:(void (^)(void))completion; - -/** @fn sharedInstance - @brief Gets a shared instance of the class. - */ -+ (instancetype)sharedInstance; - -/** @fn app - @brief A shortcut to get the currently active app. - */ -+ (FIRApp *)app; - -/** @fn auth - @brief A shortcut to get the auth instance for the currently active app. - */ -+ (FIRAuth *)auth; - -/** @fn phoneAuthProvider - @brief A shortcut to get the phone auth provider for the currently active app. - */ -+ (FIRPhoneAuthProvider *)phoneAuthProvider; - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/AppManager.m b/FirebaseAuth/Tests/Sample/Sample/AppManager.m deleted file mode 100644 index f0fb0a5d671..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/AppManager.m +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "AppManager.h" - -#import -@import FirebaseAuth; - -NS_ASSUME_NONNULL_BEGIN - -@implementation AppManager { - /** @var _createdAppNames - @brief The set of names of live (created but not deleted) app, to avoid iCore warnings. - */ - NSMutableSet *_liveAppNames; -} - -- (instancetype)init { - self = [super init]; - if (self) { - _count = 2; - _liveAppNames = [[NSMutableSet alloc] initWithCapacity:_count - 1]; - } - return self; -} - -- (nullable FIRApp *)appAtIndex:(int)index { - if (index == 0) { - return [FIRApp defaultApp]; - } - NSString *name = [self appNameWithIndex:index]; - if ([_liveAppNames containsObject:name]) { - return [FIRApp appNamed:[self appNameWithIndex:index]]; - } - return nil; -} - -- (void)recreateAppAtIndex:(int)index - withOptions:(nullable FIROptions *)options - completion:(void (^)(void))completion { - [self deleteAppAtIndex:index completion:^() { - if (index == 0) { - if (options) { - [FIRApp configureWithOptions:options]; - } - } else { - NSString *name = [self appNameWithIndex:index]; - if (options) { - [FIRApp configureWithName:name options:options]; - [self->_liveAppNames addObject:name]; - } else { - [self->_liveAppNames removeObject:name]; - } - } - completion(); - }]; -} - -+ (instancetype)sharedInstance { - static dispatch_once_t onceToken; - static AppManager *sharedInstance; - dispatch_once(&onceToken, ^{ - sharedInstance = [[self alloc] init]; - }); - return sharedInstance; -} - -+ (FIRApp *)app { - AppManager *manager = [self sharedInstance]; - return [manager appAtIndex:manager.active]; -} - -+ (FIRAuth *)auth { - return [FIRAuth authWithApp:[self app]]; -} - -+ (FIRPhoneAuthProvider *)phoneAuthProvider { - return [FIRPhoneAuthProvider providerWithAuth:[self auth]]; -} - -#pragma mark - Helpers - -/** @fn appNameWithIndex: - @brief Gets the app name for the given index. - @param index The index of the app managed by this instance. - @return The app name for the FIRApp instance. - */ -- (NSString *)appNameWithIndex:(int)index { - return [NSString stringWithFormat:@"APP_%02d", index]; -} - -/** @fn deleteAppAtIndex:withOptions:completion: - @brief Deletes the app at the given index. - @param index The index of the app to be deleted, 0 being the default app. - @param completion The block to call when completes. - */ -- (void)deleteAppAtIndex:(int)index - completion:(void (^)(void))completion { - FIRApp *app = [self appAtIndex:index]; - if (app) { - [app deleteApp:^(BOOL success) { - if (success) { - completion(); - } else { - NSLog(@"Failed to delete app '%@'.", app.name); - } - }]; - } else { - completion(); - } -} - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/ApplicationDelegate.h b/FirebaseAuth/Tests/Sample/Sample/ApplicationDelegate.h deleted file mode 100644 index 176e312ff5f..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/ApplicationDelegate.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -NS_ASSUME_NONNULL_BEGIN - -@protocol OpenURLDelegate - -/** @fn handleOpenURL:sourceApplication: - @brief Handles application:openURL:... methods for @c UIApplicationDelegate . - */ -- (BOOL)handleOpenURL:(NSURL *)url sourceApplication:(nullable NSString *)sourceApplication; - -@end - -/** @class ApplicationDelegate - @brief The sample application's delegate. - */ -@interface ApplicationDelegate : UIResponder - -/** @property window - @brief The sample application's @c UIWindow. - */ -@property(strong, nonatomic) UIWindow *window; - -/** @fn setOpenURLDelegate: - @brief Sets the delegate to handle application:openURL:... methods. - @param openURLDelegate The delegate which is not retained by this method. - */ -+ (void)setOpenURLDelegate:(nullable id)openURLDelegate; - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/ApplicationDelegate.m b/FirebaseAuth/Tests/Sample/Sample/ApplicationDelegate.m deleted file mode 100644 index d1e525a89f3..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/ApplicationDelegate.m +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "ApplicationDelegate.h" - -#import -#import -#import - -#import "AuthProviders.h" -#import -#import "GTMSessionFetcherLogging.h" -#import "MainViewController.h" - -/** @var gOpenURLDelegate - @brief The delegate to for application:openURL:... method. - */ -static __weak id gOpenURLDelegate; - -@implementation ApplicationDelegate { - // The main view controller of the sample app. - MainViewController *_sampleAppMainViewController; -} - -+ (void)setOpenURLDelegate:(nullable id)openURLDelegate { - gOpenURLDelegate = openURLDelegate; -} - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [GTMSessionFetcher setLoggingEnabled:YES]; - [[FIRConfiguration sharedInstance] setLoggerLevel:FIRLoggerLevelInfo]; - - // Configure the default Firebase application: - [FIRApp configure]; - - [[FBSDKApplicationDelegate sharedInstance] application:application - didFinishLaunchingWithOptions:launchOptions]; - - // Load and present the UI: - UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; - _sampleAppMainViewController = - [[MainViewController alloc] initWithNibName:NSStringFromClass([MainViewController class]) - bundle:nil]; - _sampleAppMainViewController.navigationItem.title = @"Firebase Auth"; - window.rootViewController = [[UINavigationController alloc] - initWithRootViewController:_sampleAppMainViewController]; - self.window = window; - [self.window makeKeyAndVisible]; - - return YES; -} - -- (BOOL)application:(nonnull UIApplication *)application - openURL:(nonnull NSURL *)url - options:(nonnull NSDictionary *)options { - [[FBSDKApplicationDelegate sharedInstance] application:application - openURL:url - options:options]; - - return [self application:application - openURL:url - sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey] - annotation:options[UIApplicationOpenURLOptionsAnnotationKey]]; -} - -- (BOOL)application:(UIApplication *)application - openURL:(NSURL *)url - sourceApplication:(NSString *)sourceApplication - annotation:(id)annotation { - if ([gOpenURLDelegate handleOpenURL:url sourceApplication:sourceApplication]) { - return YES; - } - if ([_sampleAppMainViewController handleIncomingLinkWithURL:url]) { - return YES; - } - return NO; -} - -- (BOOL)application:(UIApplication *)application -continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray> * _Nullable))restorationHandler { - if (userActivity.webpageURL) { - return [_sampleAppMainViewController handleIncomingLinkWithURL:userActivity.webpageURL]; - } - return NO; -} - -@end diff --git a/FirebaseAuth/Tests/Sample/Sample/ApplicationTemplate.plist b/FirebaseAuth/Tests/Sample/Sample/ApplicationTemplate.plist deleted file mode 100644 index d869da000cf..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/ApplicationTemplate.plist +++ /dev/null @@ -1,88 +0,0 @@ - - - - - CFBundleName - ${PRODUCT_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - UIRequiredDeviceCapabilities - - armv7 - - CFBundleVersion - 1.0 - UIBackgroundModes - - remote-notification - - CFBundleExecutable - ${EXECUTABLE_NAME} - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - CFBundleDisplayName - FirebaseAuth Sample - LSApplicationQueriesSchemes - - fbauth2 - - CFBundleURLTypes - - - CFBundleURLName - $REVERSED_CLIENT_ID - CFBundleURLSchemes - - $REVERSED_CLIENT_ID - - CFBundleTypeRole - Editor - - - CFBundleURLName - $REVERSED_CLIENT_MULTI_ID - CFBundleURLSchemes - - $REVERSED_CLIENT_MULTI_ID - - CFBundleTypeRole - Editor - - - CFBundleURLName - $BUNDLE_ID - CFBundleURLSchemes - - $BUNDLE_ID - - CFBundleTypeRole - Editor - - - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleDevelopmentRegion - en - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - CFBundleShortVersionString - 1.0 - - diff --git a/FirebaseAuth/Tests/Sample/Sample/AuthCredentialsTemplate.h b/FirebaseAuth/Tests/Sample/Sample/AuthCredentialsTemplate.h deleted file mode 100644 index 0b593af2599..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/AuthCredentialsTemplate.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* -Some of the Auth Credentials needs to be populated for the Sample build to work. - -Please follow the following steps to populate the valid AuthCredentials -and copy it to AuthCredentials.h file - -You will need to replace the following values: - -$KFACEBOOK_APP_ID -FACEBOOK_APP_ID is the developer's Facebook app's ID, to be used to test the -'Signing in with Facebook' feature of Firebase Auth. Follow the instructions -on the Facebook developer site: https://developers.facebook.com/docs/apps/register -to obtain such an id. -*/ - -#define KFACEBOOK_APP_ID $KFACEBOOK_APP_ID -#define KCONTINUE_URL $KCONTINUE_URL diff --git a/FirebaseAuth/Tests/Sample/Sample/AuthProviders.h b/FirebaseAuth/Tests/Sample/Sample/AuthProviders.h deleted file mode 100644 index 05b7a083bc2..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/AuthProviders.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -@class FIRAuthCredential; - -NS_ASSUME_NONNULL_BEGIN - -/** @typedef AuthCredentialCallback - @brief The type of block invoked when a @c FIRAuthCredential object is ready or an error has - occurred. - @param credential The auth credential if any. - @param error The error which occurred, if any. - */ -typedef void (^AuthCredentialCallback)(FIRAuthCredential *_Nullable credential, - NSError *_Nullable error); -/** @protocol AuthProvider - @brief A common interface for auth providers to be used by the sample app. - */ -@protocol AuthProvider - -/** @fn getAuthCredentialWithPresentingViewController:callback: - @brief Gets a @c FIRAuthCredential instance for use with Firebase headless API by signing in. - @param viewController The view controller to present the UI. - @param callback A block which is invoked when the sign-in flow finishes. Invoked asynchronously - on an unspecified thread in the future. - */ -- (void)getAuthCredentialWithPresentingViewController:(UIViewController *)viewController - callback:(AuthCredentialCallback)callback; - -/** @fn signOut - @brief Logs out the current provider session, which invalidates any cached crendential. - */ -- (void)signOut; - -@end - -/** @class AuthProviders - @brief Namespace for @c AuthProvider instances. - */ -@interface AuthProviders : NSObject - -/** @fn google - @brief Returns a Google auth provider. - */ -+ (id)google; - -/** @fn facebook - @brief Returns a Facebook auth provider. - */ -+ (id)facebook; - -/** @fn init - @brief This class is not supposed to be instantiated. - */ -- (nullable instancetype)init NS_UNAVAILABLE; - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/AuthProviders.m b/FirebaseAuth/Tests/Sample/Sample/AuthProviders.m deleted file mode 100644 index a8a88ac49e6..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/AuthProviders.m +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "AuthProviders.h" - -#import "FacebookAuthProvider.h" -#import "GoogleAuthProvider.h" - -@implementation AuthProviders - -+ (id)google { - static id googleAuthProvider; - if (!googleAuthProvider) { - googleAuthProvider = [[GoogleAuthProvider alloc] init]; - } - return googleAuthProvider; -} - -+ (id)facebook { - static id facebookAuthProvider; - if (!facebookAuthProvider) { - facebookAuthProvider = [[FacebookAuthProvider alloc] init]; - } - return facebookAuthProvider; -} - -@end diff --git a/FirebaseAuth/Tests/Sample/Sample/AuthSample-Bridging-Header.h b/FirebaseAuth/Tests/Sample/Sample/AuthSample-Bridging-Header.h deleted file mode 100644 index 229724c7f2c..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/AuthSample-Bridging-Header.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - diff --git a/FirebaseAuth/Tests/Sample/Sample/CustomTokenDataEntryViewController.h b/FirebaseAuth/Tests/Sample/Sample/CustomTokenDataEntryViewController.h deleted file mode 100644 index c4ba32391c1..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/CustomTokenDataEntryViewController.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** @typedef CustomTokenDataEntryViewControllerCompletion - @brief The type of callback block invoked when a @c CustomTokenDataEntryViewController is - dismissed (by either being cancelled or completed by the user.) - @param cancelled Indicates the user cancelled the flow and didn't want to enter a token. - @param userEnteredTokenText The token text the user entered. - */ -typedef void (^CustomTokenDataEntryViewControllerCompletion) - (BOOL cancelled, NSString *_Nullable userEnteredTokenText); - -/** @class CustomTokenDataEntryViewController - @brief Simple view controller to allow data entry of custom BYOAuth tokens. - */ -@interface CustomTokenDataEntryViewController : UIViewController - -/** @fn initWithNibName:bundle: - @brief Please use initWithCompletion: - */ -- (instancetype)initWithNibName:(NSString *_Nullable)nibNameOrNil - bundle:(NSBundle *_Nullable)nibBundleOrNil NS_UNAVAILABLE; - -/** @fn initWithCoder: - @brief Please use initWithCompletion: - */ -- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE; - -/** @fn initWithCompletion: - @brief Designated initializer. - @param completion A block which will be invoked when the user either chooses "cancel" or "done". - */ -- (nullable instancetype)initWithCompletion: - (CustomTokenDataEntryViewControllerCompletion)completion NS_DESIGNATED_INITIALIZER; - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/CustomTokenDataEntryViewController.m b/FirebaseAuth/Tests/Sample/Sample/CustomTokenDataEntryViewController.m deleted file mode 100644 index 0b9f9affe24..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/CustomTokenDataEntryViewController.m +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "CustomTokenDataEntryViewController.h" - -/** @var navigationBarDefaultHeight - @brief The default height to use for new navigation bars' frames. - */ -static const NSUInteger navigationBarDefaultHeight = 55; - -/** @var navigationBarSystemHeight - @brief Set after a navigation bar has been created to obtain the system-specified height of the - navigation bar. - */ -static NSUInteger navigationBarSystemHeight = navigationBarDefaultHeight; - -/** @var kTitle - @brief The title of the view controller as it appears at the top of the screen in the navigation - bar. - */ -static NSString *const kTitle = @"Enter Token"; - -/** @var kCancel - @brief The text for the "Cancel" button. - */ -static NSString *const kCancel = @"Cancel"; - -/** @var kDone - @brief The text for the "Done" button. - */ -static NSString *const kDone = @"Done"; - -@implementation CustomTokenDataEntryViewController { - /** @var _completion - @brief The block we will call when the user presses the "cancel" or "done" buttons. - @remarks Passed into the initializer. - */ - CustomTokenDataEntryViewControllerCompletion _completion; - - /** @var _tokenTextView - @brief The text view allowing the user to enter their custom token text. - @remarks Constructed and set in the method: @c loadTextView. - */ - __weak UITextView *_Nullable _tokenTextView; -} - -- (nullable instancetype)initWithCompletion: - (CustomTokenDataEntryViewControllerCompletion)completion { - self = [super initWithNibName:nil bundle:nil]; - if (self) { - _completion = completion; - } - return self; -} - -- (void)viewDidLoad { - [super viewDidLoad]; - [self loadHeader]; - [self loadTextView]; -} - -#pragma mark - View - -/** @fn loadHeader - @brief Loads the header bar along the top of the view with "Cancel" and "Done" buttons, as well - as a brief title asking the user to enter the custom token text. - @remarks Updates navigationBarSystemHeight, so should be called before any method which depends - on that variable being updated (like the @c loadTextView method, which uses the value to - determine how much room is left on the screen.) - */ -- (void)loadHeader { - CGRect navBarFrame = CGRectMake(0, 0, self.view.bounds.size.width, navigationBarDefaultHeight); - UINavigationBar *navBar = [[UINavigationBar alloc] initWithFrame:navBarFrame]; - navBar.autoresizingMask = UIViewAutoresizingFlexibleWidth - | UIViewAutoresizingFlexibleBottomMargin; - - UINavigationItem *navItem = [[UINavigationItem alloc] initWithTitle:kTitle]; - UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithTitle:kCancel - style:UIBarButtonItemStylePlain - target:self - action:@selector(cancelPressed:)]; - UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:kDone - style:UIBarButtonItemStylePlain - target:self - action:@selector(donePressed:)]; - navItem.leftBarButtonItem = cancelButton; - navItem.rightBarButtonItem = doneButton; - - [navBar setItems:@[ navItem ] animated:NO]; - - [self.view addSubview:navBar]; - - // Obtain the system-specified height of the navigation bar. - navigationBarSystemHeight = navBar.frame.size.height; -} - -/** @fn loadTextView - @brief Loads the text field for the user to enter their custom token text. - @remarks Relies on the navigationBarSystemHeight variable being correct. - */ -- (void)loadTextView { - CGRect tokenTextViewFrame = - CGRectMake(0, - navigationBarSystemHeight, - self.view.bounds.size.width, - self.view.bounds.size.height - navigationBarSystemHeight); - UITextView *tokenTextView = [[UITextView alloc] initWithFrame:tokenTextViewFrame]; - tokenTextView.backgroundColor = [UIColor whiteColor]; - tokenTextView.textAlignment = NSTextAlignmentLeft; - - [self.view addSubview:tokenTextView]; - _tokenTextView = tokenTextView; -} - -#pragma mark - Actions - -- (void)cancelPressed:(id)sender { - [self finishByCancelling:YES withUserEnteredTokenText:nil]; -} - -- (void)donePressed:(id)sender { - [self finishByCancelling:NO withUserEnteredTokenText:_tokenTextView.text]; -} - -#pragma mark - Workflow - -- (void)finishByCancelling:(BOOL)cancelled - withUserEnteredTokenText:(nullable NSString *)userEnteredTokenText { - [self dismissViewControllerAnimated:YES completion:^{ - self->_completion(cancelled, - cancelled ? nil : userEnteredTokenText); - }]; -} - -@end diff --git a/FirebaseAuth/Tests/Sample/Sample/Dummy.swift b/FirebaseAuth/Tests/Sample/Sample/Dummy.swift deleted file mode 100644 index bddf99ec845..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/Dummy.swift +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Foundation diff --git a/FirebaseAuth/Tests/Sample/Sample/FacebookAuthProvider.h b/FirebaseAuth/Tests/Sample/Sample/FacebookAuthProvider.h deleted file mode 100644 index 8aefca5dad0..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/FacebookAuthProvider.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#import "AuthProviders.h" - -NS_ASSUME_NONNULL_BEGIN - -/** @class FacebookAuthProvider - @brief The implementation for Facebook auth provider related methods. - */ -@interface FacebookAuthProvider : NSObject -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/FacebookAuthProvider.m b/FirebaseAuth/Tests/Sample/Sample/FacebookAuthProvider.m deleted file mode 100644 index 223e26da167..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/FacebookAuthProvider.m +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "FacebookAuthProvider.h" - -#import -#import - -@import FirebaseAuth; -#import "ApplicationDelegate.h" -#import "AuthCredentials.h" - -/** @var kFacebookAppId - @brief The App ID for the Facebook SDK. - */ -static NSString *const kFacebookAppID = KFACEBOOK_APP_ID; - -@interface FacebookAuthProvider () -@end - -@implementation FacebookAuthProvider { - FBSDKLoginManager *_loginManager; -} - -- (instancetype)init { - self = [super init]; - if (self) { - _loginManager = [[FBSDKLoginManager alloc] init]; - } - return self; -} - -- (void)getAuthCredentialWithPresentingViewController:(UIViewController *)viewController - callback:(AuthCredentialCallback)callback { - [self signOut]; - - [ApplicationDelegate setOpenURLDelegate:self]; - //[FBSDKSettings setAppID:kFacebookAppID]; - [_loginManager logInWithPermissions:@[ @"email" ] - fromViewController:viewController - handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) { - [ApplicationDelegate setOpenURLDelegate:nil]; - if (!error && result.isCancelled) { - error = [NSError errorWithDomain:@"com.google.FirebaseAuthSample" code:-1 userInfo:nil]; - } - if (error) { - callback(nil, error); - return; - } - NSString *accessToken = [FBSDKAccessToken currentAccessToken].tokenString; - callback([FIRFacebookAuthProvider credentialWithAccessToken:accessToken], nil); - }]; -} - -- (void)signOut { - [_loginManager logOut]; -} - -- (BOOL)handleOpenURL:(NSURL *)URL sourceApplication:(NSString *)sourceApplication { - return [[FBSDKApplicationDelegate sharedInstance] application:[UIApplication sharedApplication] - openURL:URL - sourceApplication:sourceApplication - annotation:nil]; -} - -@end diff --git a/FirebaseAuth/Tests/Sample/Sample/GoogleAuthProvider.h b/FirebaseAuth/Tests/Sample/Sample/GoogleAuthProvider.h deleted file mode 100644 index 05c1bf27fc0..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/GoogleAuthProvider.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#import "AuthProviders.h" - -NS_ASSUME_NONNULL_BEGIN - -/** @class GoogleAuthProvider - @brief The implementation for Google auth provider related methods. - */ -@interface GoogleAuthProvider : NSObject -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/GoogleAuthProvider.m b/FirebaseAuth/Tests/Sample/Sample/GoogleAuthProvider.m deleted file mode 100644 index b405a73f2cc..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/GoogleAuthProvider.m +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "GoogleAuthProvider.h" - -#import - -#import "AppManager.h" -#import -#import -@import FirebaseAuth; - -@implementation GoogleAuthProvider - -- (void)getAuthCredentialWithPresentingViewController:(UIViewController *)viewController - callback:(AuthCredentialCallback)callback { - [self signOut]; - - GIDSignIn *signIn = GIDSignIn.sharedInstance; - GIDConfiguration *config = [[GIDConfiguration alloc] initWithClientID:[self googleClientID]]; - [signIn signInWithConfiguration:config - presentingViewController:viewController - callback:^(GIDGoogleUser * _Nullable user, NSError * _Nullable error) { - if (error) { - callback(nil, error); - return; - } - GIDAuthentication *auth = user.authentication; - FIRAuthCredential *credential = [FIRGoogleAuthProvider credentialWithIDToken:auth.idToken - accessToken:auth.accessToken]; - callback(credential, error); - }]; -} - -- (void)signOut { - [GIDSignIn.sharedInstance signOut]; -} - -- (NSString *)googleClientID { - return [AppManager app].options.clientID; -} - -@end diff --git a/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/Contents.json b/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 9f9548e665e..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,204 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "logo_avatar_square_grey_color_1x_ios_21in29dp-1.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "logo_avatar_square_grey_color_2x_ios_21in29dp-1.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "logo_avatar_square_grey_color_3x_ios_21in29dp.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "logo_avatar_square_grey_color_2x_ios_29in40dp-1.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "logo_avatar_square_grey_color_3x_ios_29in40dp-1.png", - "scale" : "3x" - }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "logo_avatar_square_grey_color_1x_ios_42in57dp.png", - "scale" : "1x" - }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "logo_avatar_square_grey_color_2x_ios_42in57dp.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "logo_avatar_square_grey_color_2x_ios_44in60dp.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "logo_avatar_square_grey_color_3x_ios_44in60dp.png", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "logo_avatar_square_grey_color_1x_ios_21in29dp.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "logo_avatar_square_grey_color_2x_ios_21in29dp.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "logo_avatar_square_grey_color_1x_ios_29in40dp-1.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "logo_avatar_square_grey_color_2x_ios_29in40dp-2.png", - "scale" : "2x" - }, - { - "size" : "50x50", - "idiom" : "ipad", - "filename" : "logo_avatar_square_grey_color_1x_ios_38in50dp.png", - "scale" : "1x" - }, - { - "size" : "50x50", - "idiom" : "ipad", - "filename" : "logo_avatar_square_grey_color_2x_ios_38in50dp.png", - "scale" : "2x" - }, - { - "size" : "72x72", - "idiom" : "ipad", - "filename" : "logo_avatar_square_grey_color_1x_ios_53in72dp.png", - "scale" : "1x" - }, - { - "size" : "72x72", - "idiom" : "ipad", - "filename" : "logo_avatar_square_grey_color_2x_ios_53in72dp.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "logo_avatar_square_grey_color_1x_ios_56in76dp.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "logo_avatar_square_grey_color_2x_ios_56in76dp.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "ItunesArtwork@2x.png", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "16x16", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "16x16", - "scale" : "2x" - }, - { - "idiom" : "mac", - "size" : "32x32", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "32x32", - "scale" : "2x" - }, - { - "idiom" : "mac", - "size" : "128x128", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "128x128", - "scale" : "2x" - }, - { - "idiom" : "mac", - "size" : "256x256", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "256x256", - "scale" : "2x" - }, - { - "idiom" : "mac", - "size" : "512x512", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "512x512", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index 57aa7804cb1cd192e9dfda2f482a18dcf368d2a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1237 zcmeAS@N?(olHy`uVBq!ia0vp^%R!g}NH7G}3L7vmu*~svaSW-L^LEbdqDK}2ZM#*Q zE!z(Jl->LPG_CuLkOEsx*!iO=+ctIbPWzf3ne}_WN2rYJuRCSiqjVX$@3x*<%V_0g zxiQFZ%@kqnr$7hFAZHvD~x?DY))htC)N+-4VR6ytsQg6{df7WZEqE!Djq zZE^F?se@7T9`F6JyC`YtoCrH5pUCdQ*btkv%u|6aI4U*u`Mn#A??8+<{ ze3T6Hirpea4xBt1d{wIP$Q6Ipgb5$?ZoK`(-58X!Z}nkat{qq3B|qJ_2n~|6j6Nm%Dq{=0kt?2Cu$-{AYKuTHcHYe7jUP9L&rs z_#;!6C3fGcF6houcHwqDVVUQZHFqbc$kZrk*{q*ko?)_o@BYtEcJ;eVzFpiE8_WG@ zQ`P=W-^CMZO}h1iHXPaf|IjZFw)h`P?CaSdYF8ZjV;3Fgp?`C2T7x0OoI|fGwKcAP z7G0FlzT$Sr-{xCko?rhM-s$9+a^3Swt|RYp#mJ1Wyup!2u81DB>)R%O+PL(~SH_T) ztXJ)i+VsTTn<{){%{1l^N6Aosv9A3(lcs+%RTW!w@QhP*4yp^a_hofr%gAV zD0^hFqH&MVZhhqxw|eyg9|x}w|1REs!&}q$r+#<-4^ME~TJ7KA{l{8E(fncJoI^)a zI!^7Ra{U-&I?=Bq_It4~=9Dy1ba$}o_Ky0V7lK}wP9EYYnToqy)F&zLde zCg0=29EQok66%vZ=FR&YZl_lFJIHF$Dhs3Ik56`3@R&7B_I&lHVpT_r^xS9HRSPqJ z+05{9S7X^~t{xn!>gnopU1oOYiaYNY|I866ynm?3-*1_c^^%gxhyTvkuPERBG0EnI z=dJc&9?|8_=jI*HoN?)LhGFN*^Lgp=e$jLIR&M<#*uJ>PILfcx*5}n(%`+$e9SK~& zLqkM#_RA!_dmr!5zP#h@zITbI!#QUMPt#YvpZ@-&=CT|63IbZ4*W`4s-}t<5x%~1Q zIg{J`^qtgJ%Bj~asH>cNa($nekgbNMFr$oIlz0<+b;`UnRrNC^|m9s&=zl z@=AKlWYv8ZZy%|AmfBq%Y?#^QebKk^6ArJ zuF5Af_Nw{IS2uY_#}&WdyXO8>%zO>Y?Wb0+J8}0r@2)S;fX=Vxp6&Hw-ItXKF_SkG z%exoqc0Uz6mw5QD)aEuZmqnR>CI&~H>%af?yY{xZuNdzKpEeIRi{C3;ea|}vW*lna c0Tiuc+Pbb~NgspwQBZm1>FVdQ&MBb@01UoZNB{r; diff --git a/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png b/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png deleted file mode 100644 index 03513605f80e4d11f981ef5b45bce3be57bbcbe7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 23825 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 YShNJT&8l<}Mh-c0$mU?dez)uY2AzL=X8-^I diff --git a/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_1x_ios_21in29dp-1.png b/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_1x_ios_21in29dp-1.png deleted file mode 100644 index 2976035cf3dd1e5e4559abb740def6a3cd7ca97d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 169 zcmeAS@N?(olHy`uVBq!ia0vp^vLMU>Bp8Z+SX>5D1)eUBAsWGF&wFzin9-!ZpeGCmCSKq zOOr0B$r*fX*>*2$_k+#%8{D4XO4t#koZvTOG8=1lrbPzt?GFp`mcNr$t@f{0zsV5J S?#Gn{a)YOBp8Z+SX>5D1)eUBAsWGF&wFzin9-!ZpeGCmCSKq zOOr0B$r*fX*>*2$_k+#%8{D4XO4t#koZvTOG8=1lrbPzt?GFp`mcNr$t@f{0zsV5J S?#Gn{a)YODw|_>ZQ49a1|y$@|GAZM s=*A|cNvRf#a$?$KPgR`1@G|`YcmKJqxyN{>XMr5&>FVdQ&MBb@0OFEP?EnA( diff --git a/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_1x_ios_38in50dp.png b/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_1x_ios_38in50dp.png deleted file mode 100644 index 0c98554c0f7c65011710037965d573e250d0976a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 222 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*@qBp9qiuIB=&rJgR1Ar*{oFFEox83?!~zOP>{ z&!rh0IWb_1nv~T%7iGoG1|rJ~T`z6_U-tgXsdW?l{X>r{w|;ms>zJ>kiqJHTEKcET z9^Psm;;Mxc=1h|C@U=7aa+=`bX``}UN~IBzMjW9|Msd%F6$taD0e0stMxS0MlZ diff --git a/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_1x_ios_42in57dp.png b/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_1x_ios_42in57dp.png deleted file mode 100644 index 3ef403a58a2c674788e6751be79ec51b8414f6b0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 251 zcmVAL|DK-hOj1NyH56ytID5U40?AsGp1nd)vH$nqx97QgIor?6BA4unEHYC@ z(_Ai%iEQZ<)|6vPFY%TPJXzzth9#eog8f zOIYTHh7FGF-TGDlqIGA!LLty!`6q>Wn&v<}NmkzrtchA%%9XyC_>}B@j=XmGn&_@K zrLXX9D%_A!VW%n{%K^KM$5LZAUF83l{EGag@)d6%j^Gy86iWaA002ovPDHLkV1lit Bal8Nk diff --git a/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_1x_ios_53in72dp.png b/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_1x_ios_53in72dp.png deleted file mode 100644 index ff6c804078e2aa668bbc737b5c857758122ffea5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 303 zcmV+~0nq-5P)VE~wNk}o!zhF8+%zW|XN zyRIJ{Ng#K&nZZXUtIs|O@=b=H?OT5<&ag6LE^dSHM002ovPDHLkV1hDR Bfaw4L diff --git a/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_1x_ios_56in76dp.png b/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_1x_ios_56in76dp.png deleted file mode 100644 index df8a9537087da8cc88289c67f144951e42fbc152..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 315 zcmV-B0mS}^P)VVyb42BAv*e)9ZsSuP{K-}C&i0b|e_+BiZhkN(7V*eRqjIr~w z9Ak_zb_>{ZbvV>7t6)0ArTmeMd5NzS729LfJq>FxNmDSFU{c}$@dVxv860oxhACrQ)45Knf`wT+F( zT#lJ?AB~lmt&GMJ%$CGr77_V1G0PZZH-@<(BO>bDXRmwVp^ z+;19pIq`qkcLETdyR;k%fo`-{3d=k%ftZx6eiYaejka`}`a$AHa`30<+T(YkU-Q)0 y_%ju9G%6fa#|#~D*p#6fhv|Pp3uSi$TIdHdegS-1ITxJ(0000Vp^ z+;19pIq`qkcLETdyR;k%fo`-{3d=k%ftZx6eiYaejka`}`a$AHa`30<+T(YkU-Q)0 y_%ju9G%6fa#|#~D*p#6fhv|Pp3uSi$TIdHdegS-1ITxJ(0000@)V3rK?T17J`>gRIt^qT P00000NkvXXu0mjf01bwv diff --git a/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_2x_ios_29in40dp-2.png b/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_2x_ios_29in40dp-2.png deleted file mode 100644 index 9452a267c85803f0f15a057b5b54f9369d2a6174..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 317 zcmV-D0mA-?P)@)V3rK?T17J`>gRIt^qT P00000NkvXXu0mjf01bwv diff --git a/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_2x_ios_38in50dp.png b/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_2x_ios_38in50dp.png deleted file mode 100644 index 436be1042ce34c90615ca6fe7f3750775be55f22..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 390 zcmV;10eSw3P)l771w$Tx7Z!NTcB@)$k*&hFQAhM!bQW63>j3 zKveP~9w`JpD{=y|6DyL_NY09EXk^2R7#c~Qff!cgl}6UANJb+WD{`QbBP%j$%Fvz_ znF2xj>M3wZ$jn6#Dfsb-X@49-4F60 z1^I=@&{Qt7+ijY;su}nZ|6W>zt5&vbJs;waI|MS^op_MGmcw#-}-llyJp_wPARZ>z^7lT0$nWZ0OT z31X5-CYfZCNhX>6*QDx;bh}NtWD0A~bmRy}XEL&aqneD|!cj^^8UaVb5RnSb6cH)mOcIeA&NLA@$8Z$S zRAdfEJ2J9^qmGPJ5v)a;jGP--Yi2sqY+xzTgyeh{xJjI8hsbbaih+7=jWMo@NBU8z z3VbCBwaRp!sstZx>S?`$AWz5RN%9S1l1Xd&GQ6}^SypW~Tr@Rl#=|bbRmtu!8Y=R& z%LS}Oc_+h@y3g=yS+9eVvWf6#QLTcJx)!)A(U>sgkl^l;QvlL5c&OH&Ebw5ZFWKVZ zT0e5af+jDr#DYpMGQxr)A5vja+Jlr>l=LT=WRgiHnPiel@|X-7lT0$nB$Mwesyo7M S)+BHM00008iQ;L0fs1YZ;FPF8!SMU}8<;+@IebJ2O6G=8-T+IM5*P#K;C= zF*5(FPbj{&GAOgu%<-Y-^7~JN4Q^!pT79amaeB+YmnlvM+%9^bI&oNU;Z#3AnRS_4 z-K6#jURL7C=3AGN=p8drxYa#rch{l&l{-XRP5HwY6&yUgR3oO2YhC3Iu~ut2yY55A z{O1>K2%ochkH(q(rN1Y%=I(iSEKH*A%j*xWb&Xg4Y**#}{pqUiUX4Ffr0eQ9-oH}( zIobDELG!)uFDIX^lK)n=t3UR3*<;!3j~Ib2KNlq~@+~c+beYnx&?QE9`MSm1|K1Tb z+$$n}_s!D;^A|I2EXpcT`mpxl)#Z0}+7Ac&#jl#d*XrvSzs{ij;J)4$bFJ!ma=5FE z-}W`cy5&#*&HP}JS;)I~{VgjK&1-J4Ew6sqYPRi7OZ(anrRsO`TdNN=Ffy~9VV5v? ekN^v@nRQIdzPSFat}TuSMTn=XpUXO@geCx-2gITP diff --git a/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_2x_ios_53in72dp.png b/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_2x_ios_53in72dp.png deleted file mode 100644 index 0ddd72093965f07776a8e63cdc3f29ba93795664..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 540 zcmeAS@N?(olHy`uVBq!ia0vp^6F`^)NH84I-J8O|!1&nH#WAFU@$K#CqS*!vtqCrChwa$%ppguYqof6Jzt=8Wci|7njXu31g*N$_=}^wi!FSC-GRG@ z4)S`q&Cm$)bI?>f9n+ANktNfhlwoy)J@mr02zJ#A({8b8^56Ql&5<|ll}>Y$yvIuikRX_D-0_@?_`gL(3nTKQHzv z|MqcW{kv@&7wqlaq~Ue3_>yvmLK8=of7zlln^in7>FB#^$2PGQb~4|2a$MZdg5l(K zodYR}zqE3j+CH`H+>>m1gHcoP@%v9n3&Yq?W;d{ZT3-}8Vb{Bl3BR4zvae#c2@F`v z5~Mj#Cpf#|7xO$lsWZ*L7`VBrE-OeT1uit<@!GKAh|Y?GkD?YYVCnvyDYT?4;*Osr z%U6Sdbb%{}9C{rCc$v4tf*%y>Ut%3Tc^@*KFk$=ONBb`!$^8Ajz`o=0as6M?AMSyo N-P6_2Wt~$(696Mb=j;Fg diff --git a/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_2x_ios_56in76dp.png b/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_2x_ios_56in76dp.png deleted file mode 100644 index 2f028cbfe21b6e5a0d1f2b32d47d4120ccbd7bbd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 573 zcmeAS@N?(olHy`uVBq!ia0vp^GeDRFNHEy0tpCfvz{KL|;uuoF`1VfVwpj)utq;%D z`~4Q+?%lHD0c%KC%Z<)0`LVg7LF*4X@BU`r^j&$fFGOZjBK&p*T1-g)k2f6rEaE6blnH81RC zzg9a-_{_sX*W|)E>b$wOPk8ulkKvD*H|L3)l>S<$l{4*T(*4T5!{9LZZ+m9$t4$|z zr!8A~wtJJEW$ld%@75d)?YwK&EOlnS>x|~x^PxJWB#H|N+8+~1~Ve`@5n-AA)n0!!p=Hr+RZXZG}onf}-nCElL zGGXt7mrMHjKT9fo(X@Nhpt1F0qUE9~?(M1_L64LV%P5(;w0-TkGSlD?hjI^`cr(Ab t_xfCwpt}`U&Ho8F!6R;&Ok#`X7v>-Q1`dnn9@qp*7oM(uF6*2UngHYN{x$#r diff --git a/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_3x_ios_21in29dp.png b/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_3x_ios_21in29dp.png deleted file mode 100644 index 69bb8d3a0f22a377918a3c5fe8d588930d3d5986..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 330 zcmV-Q0k!^#P) c*=3jAZwTcBQSlH!sQ>@~07*qoM6N<$f^dSNp#T5? diff --git a/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_3x_ios_29in40dp-1.png b/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_3x_ios_29in40dp-1.png deleted file mode 100644 index 7045675f657d45a371deb113f2d37e47e18a04a7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 433 zcmV;i0Z#sjP)sq5QX9Fe@{K43CvtT#EE4IGEB3Qr1E5$OD7TNF%Re8z*qg&=gW^b1sE{k{}BcZ z7%<>TC%}LKF9|SUz<>b*=5P<39PW?b=vQBxJ|)~0^r+~P!AE-T$VuR6>Gy0*0JEjf zS=NUenyXQVdov50UK_SFpHqhKBsJ*5jR>D~;ar3ZUD$~5P8E(M7d7FLYh%$o3& ziEcKj!i5N1UAPtDvo0Kr;F_QdPagtYPRj6LEG z?up&`WPf$2%)_mQluKgt?m$Eb=f^jUHpWZ^40tshyGvV_&bqR0FI`Lm^R0DzdT#I9 z8>_9tDU1dchq zTESbuj$Y4h0DD@JUk!7%2+mf+S6bF}Eqq!Cw`<{gAzT9n3>YwAIlzDcCkrrOz<>b* b1}yXw%7$UCD2U$c00000NkvXXu0mjf;Xb_X diff --git a/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_3x_ios_44in60dp.png b/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/AppIcon.appiconset/logo_avatar_square_grey_color_3x_ios_44in60dp.png deleted file mode 100644 index 211ef930e4543dc66254de27bebfd2858a47ca5e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 661 zcmeAS@N?(olHy`uVBq!ia0vp^TR@ltNH9n&i+snxz!c-@;uuoF`1WRO(QE^eqaWYZ z`@46X=nQUd6zIv7QK?jY>$9ByZ^y^n<`b#U{)B&!-m6fuuO>RtMcCKmB9!<$u|sWE z#-dKOU#k>Aq_8rWhfcgGc*o!VPbRFnuU+Z*`A>`bwH%sV$R#|TG zGWXslUg&iG)JzU<{)oaTw7Ig!m!v(#oc_yUMowh<8N-xkf?QP^6R{) zD|AK0?ft|BMuxi_nz(?Giyo=KXusANCVBA_GzlQdzj!}2Hg?v7Dvhh4^yca6=d#Wz Gp$Pyt@G+tQ diff --git a/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/Contents.json b/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/Contents.json deleted file mode 100644 index da4a164c918..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/Images.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+App.h b/FirebaseAuth/Tests/Sample/Sample/MainViewController+App.h deleted file mode 100644 index 624faffefa5..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+App.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#import "MainViewController.h" - -#import "StaticContentTableViewManager.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface MainViewController (App) - -- (StaticContentTableViewSection *)appSection; - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+App.m b/FirebaseAuth/Tests/Sample/Sample/MainViewController+App.m deleted file mode 100644 index 98b2b9613c6..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+App.m +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "MainViewController+App.h" - -#import "AppManager.h" -@import FirebaseAuth; -#import "MainViewController+Internal.h" -#import - -static NSString *const kTokenRefreshErrorAlertTitle = @"Get Token Error"; - -static NSString *const kTokenRefreshedAlertTitle = @"Token"; - -@implementation MainViewController (App) - -- (StaticContentTableViewSection *)appSection { - __weak typeof(self) weakSelf = self; - return [StaticContentTableViewSection sectionWithTitle:@"APP" cells:@[ - [StaticContentTableViewCell cellWithTitle:@"Get Token" - action:^{ [weakSelf getUserTokenResultWithForce:NO]; }], - [StaticContentTableViewCell cellWithTitle:@"Get Token Force Refresh" - action:^{ [weakSelf getUserTokenResultWithForce:YES]; }], - [StaticContentTableViewCell cellWithTitle:@"Add Auth State Change Listener" - action:^{ [weakSelf addAuthStateListener]; }], - [StaticContentTableViewCell cellWithTitle:@"Remove Last Auth State Change Listener" - action:^{ [weakSelf removeAuthStateListener]; }], - [StaticContentTableViewCell cellWithTitle:@"Add ID Token Change Listener" - action:^{ [weakSelf addIDTokenListener]; }], - [StaticContentTableViewCell cellWithTitle:@"Remove Last ID Token Change Listener" - action:^{ [weakSelf removeIDTokenListener]; }], - [StaticContentTableViewCell cellWithTitle:@"Verify Client" - action:^{ [weakSelf verifyClient]; }], - [StaticContentTableViewCell cellWithTitle:@"Delete App" - action:^{ [weakSelf deleteApp]; }], - ]]; -} - -- (void)getUserTokenResultWithForce:(BOOL)force { - [[self user] getIDTokenResultForcingRefresh:force - completion:^(FIRAuthTokenResult *_Nullable tokenResult, - NSError *_Nullable error) { - if (error) { - [self showMessagePromptWithTitle:kTokenRefreshErrorAlertTitle - message:error.localizedDescription - showCancelButton:NO - completion:nil]; - [self logFailure:@"refresh token failed" error:error]; - return; - } - [self logSuccess:@"refresh token succeeded."]; - NSString *message = [tokenResult.claims description]; - [self showMessagePromptWithTitle:kTokenRefreshedAlertTitle - message:message - showCancelButton:NO - completion:nil]; - }]; -} - -- (void)addAuthStateListener { - __weak typeof(self) weakSelf = self; - NSUInteger index = self.authStateDidChangeListeners.count; - [self log:[NSString stringWithFormat:@"Auth State Did Change Listener #%lu was added.", - (unsigned long)index]]; - // TODO: restore FIRAuthStateDidChangeListenerHandle - id handle = - [[AppManager auth] addAuthStateDidChangeListener:^(FIRAuth *_Nonnull auth, - FIRUser *_Nullable user) { - [weakSelf log:[NSString stringWithFormat: - @"Auth State Did Change Listener #%lu was invoked on user '%@'.", - (unsigned long)index, user.uid]]; - }]; - [self.authStateDidChangeListeners addObject:handle]; -} - -- (void)removeAuthStateListener { - if (!self.authStateDidChangeListeners.count) { - [self log:@"No remaining Auth State Did Change Listeners."]; - return; - } - NSUInteger index = self.authStateDidChangeListeners.count - 1; - id handle = self.authStateDidChangeListeners.lastObject; - [[AppManager auth] removeAuthStateDidChangeListener:handle]; - [self.authStateDidChangeListeners removeObject:handle]; - NSString *logString = - [NSString stringWithFormat:@"Auth State Did Change Listener #%lu was removed.", - (unsigned long)index]; - [self log:logString]; -} - -- (void)addIDTokenListener { - __weak typeof(self) weakSelf = self; - NSUInteger index = self.IDTokenDidChangeListeners.count; - [self log:[NSString stringWithFormat:@"ID Token Did Change Listener #%lu was added.", - (unsigned long)index]]; - id handle = - [[AppManager auth] addIDTokenDidChangeListener:^(FIRAuth *_Nonnull auth, - FIRUser *_Nullable user) { - [weakSelf log:[NSString stringWithFormat: - @"ID Token Did Change Listener #%lu was invoked on user '%@'.", - (unsigned long)index, user.uid]]; - }]; - [self.IDTokenDidChangeListeners addObject:handle]; -} - -- (void)removeIDTokenListener { - if (!self.IDTokenDidChangeListeners.count) { - [self log:@"No remaining ID Token Did Change Listeners."]; - return; - } - NSUInteger index = self.IDTokenDidChangeListeners.count - 1; - id handle = self.IDTokenDidChangeListeners.lastObject; - [[AppManager auth] removeIDTokenDidChangeListener:handle]; - [self.IDTokenDidChangeListeners removeObject:handle]; - NSString *logString = - [NSString stringWithFormat:@"ID Token Did Change Listener #%lu was removed.", - (unsigned long)index]; - [self log:logString]; -} - -- (void)verifyClient { - [[AppManager auth].tokenManager getTokenWithCallback:^(FIRAuthAPNSToken *_Nullable token, - NSError *_Nullable error) { - if (!token) { - [self logFailure:@"Verify iOS client failed." error:error]; - return; - } - FIRVerifyClientRequest *request = - [[FIRVerifyClientRequest alloc] initWithAppToken:token.string - isSandbox:token.type == FIRAuthAPNSTokenTypeSandbox - requestConfiguration:[AppManager auth].requestConfiguration]; - [FIRAuthBackend2 postWithRequest:request callback:^(FIRVerifyClientResponse *_Nullable response, - NSError *_Nullable error) { - if (error) { - [self logFailure:@"Verify iOS client failed." error:error]; - return; - } - NSTimeInterval timeout = [response.suggestedTimeOutDate timeIntervalSinceNow]; - [[AppManager auth].appCredentialManager - didStartVerificationWithReceipt:response.receipt - timeout:timeout - callback:^(FIRAuthAppCredential *credential) { - if (!credential.secret) { - [self logFailure:@"Failed to receive remote notification to verify app identity." - error:error]; - return; - } - NSString *testPhoneNumber = @"+16509964692"; - FIRSendVerificationCodeRequest *request = - [[FIRSendVerificationCodeRequest alloc] initWithPhoneNumber:testPhoneNumber - appCredential:credential - reCAPTCHAToken:nil - requestConfiguration: - [AppManager auth].requestConfiguration]; - [FIRAuthBackend2 postWithRequest:request - callback:^(FIRSendVerificationCodeResponse *_Nullable response, - NSError *_Nullable error) { - if (error) { - [self logFailure:@"Verify iOS client failed." error:error]; - return; - } else { - [self logSuccess:@"Verify iOS client succeeded."]; - [self showMessagePrompt:@"Verify iOS client succeed."]; - } - }]; - }]; - }]; - }]; -} - -- (void)deleteApp { - [[FIRApp defaultApp] deleteApp:^(BOOL success) { - [self log:success ? @"App deleted successfully." : @"Failed to delete app."]; - }]; -} - -@end diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Auth.h b/FirebaseAuth/Tests/Sample/Sample/MainViewController+Auth.h deleted file mode 100644 index 535448f82ff..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Auth.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#import "MainViewController.h" - -@import FirebaseAuth; -#import "StaticContentTableViewManager.h" - -typedef void (^FIRAuthDataResultCallback)(FIRAuthDataResult *_Nullable authResult, - NSError *_Nullable error); - -NS_ASSUME_NONNULL_BEGIN - -@interface MainViewController (Auth) - -- (StaticContentTableViewSection *)authSection; - -- (void)signInAnonymouslyWithCallback:(nullable FIRAuthDataResultCallback)callback; - -- (void)setAuthDomain; - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Auth.m b/FirebaseAuth/Tests/Sample/Sample/MainViewController+Auth.m deleted file mode 100644 index 34c77f76ff8..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Auth.m +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "MainViewController+Auth.h" - -#import "AppManager.h" -#import "MainViewController+Internal.h" - -NS_ASSUME_NONNULL_BEGIN - -@implementation MainViewController (Auth) - -- (StaticContentTableViewSection *)authSection { - __weak typeof(self) weakSelf = self; - return [StaticContentTableViewSection sectionWithTitle:@"Auth" cells:@[ - [StaticContentTableViewCell cellWithTitle:@"Sign in Anonymously" - action:^{ [weakSelf signInAnonymously]; }], - [StaticContentTableViewCell cellWithTitle:@"Sign out" - action:^{ [weakSelf signOut]; }], - [StaticContentTableViewCell cellWithTitle:@"Initialize Recaptcha Config" - action:^{ [weakSelf initializeRecaptchaConfig]; }], - [StaticContentTableViewCell cellWithTitle:@"Set Auth Domain" - action:^{ [weakSelf setAuthDomain]; }] - ]]; -} - -- (void)signInAnonymously { - [[AppManager auth] signInAnonymouslyWithCompletion:^(FIRAuthDataResult *_Nullable result, - NSError *_Nullable error) { - if (error) { - [self logFailure:@"sign-in anonymously failed" error:error]; - } else { - [self logSuccess:@"sign-in anonymously succeeded."]; - [self log:[NSString stringWithFormat:@"User ID : %@", result.user.uid]]; - } - [self showTypicalUIForUserUpdateResultsWithTitle:@"Sign in Anonymously" error:error]; - }]; -} - -- (void)signInAnonymouslyWithCallback:(nullable FIRAuthDataResultCallback)callback { - FIRAuth *auth = [AppManager auth]; - if (!auth) { - [self logFailedTest:@"Could not obtain auth object."]; - return; - } - [auth signInAnonymouslyWithCompletion:^(FIRAuthDataResult *_Nullable result, - NSError *_Nullable error) { - if (error) { - [self logFailure:@"sign-in anonymously failed" error:error]; - [self logFailedTest:@"Recently signed out user should be able to sign in anonymously."]; - return; - } - [self logSuccess:@"sign-in anonymously succeeded."]; - if (callback) { - callback(result, nil); - } - }]; -} - -- (void)signOut { - [[AuthProviders google] signOut]; - [[AuthProviders facebook] signOut]; - [[AppManager auth] signOut:NULL]; -} - -- (void)initializeRecaptchaConfig { - [[AppManager auth] initializeRecaptchaConfigWithCompletion:^(NSError * _Nullable error) { - if (error) { - [self logFailure:@"Initializing Recaptcha config failed" error:error]; - } else { - [self logSuccess:@"Initializing Recaptcha config succeeded."]; - } - }]; -} - -- (void)setAuthDomain { - [self showTextInputPromptWithMessage:@"Auth Domain:" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable customAuthDomain) { - if (userPressedOK && customAuthDomain.length) { - FIRAuth *auth = [AppManager auth]; - if(!auth) { - [self logFailedTest:@"Could not obtain auth object."]; - return; - } - auth.customAuthDomain = customAuthDomain; - [self logSuccess:[NSString stringWithFormat:@"Successfully set auth domain to: %@", customAuthDomain]]; - } - return; - }]; -} - - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+AutoTests.h b/FirebaseAuth/Tests/Sample/Sample/MainViewController+AutoTests.h deleted file mode 100644 index c3f2110e5de..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+AutoTests.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#import "MainViewController.h" - -#import "StaticContentTableViewManager.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface MainViewController (AutoTests) - -- (StaticContentTableViewSection *)autoTestsSection; - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+AutoTests.m b/FirebaseAuth/Tests/Sample/Sample/MainViewController+AutoTests.m deleted file mode 100644 index 6791a371901..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+AutoTests.m +++ /dev/null @@ -1,500 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "MainViewController+AutoTests.h" - -#import "AppManager.h" -#import "AuthProviders.h" -#import "MainViewController+Internal.h" -#import "MainViewController+GameCenter.h" -#import "MainViewController+Phone.h" -#import "MainViewController+User.h" -#import "MainViewController+OOB.h" -#import "MainViewController+App.h" -#import "MainViewController+Email.h" -#import "MainViewController+Google.h" -#import "MainViewController+Facebook.h" -#import "MainViewController+Auth.h" -#import "MainViewController+OAuth.h" -#import "MainViewController+Custom.h" -#import "MainViewController+AutoTests.h" - -NS_ASSUME_NONNULL_BEGIN - -static NSString *const kCustomTokenUrl = @"https://gcip-testapps.wl.r.appspot.com/token"; - -static NSString *const kExpiredCustomTokenUrl = @"https://gcip-testapps.wl.r.appspot.com/expired_token"; - -static NSString *const kInvalidCustomToken = @"invalid custom token."; - -static NSString *const kSafariGoogleSignOutMessagePrompt = @"This automated test assumes that no " -"Google account is signed in on Safari, if your are not prompted for a password, sign out on " -"Safari and rerun the test."; - -static NSString *const kSafariFacebookSignOutMessagePrompt = @"This automated test assumes that no " -"Facebook account is signed in on Safari, if your are not prompted for a password, sign out on " -"Safari and rerun the test."; - -static NSString *const kUnlinkAccountMessagePrompt = @"Sign into gmail with an email address " -"that has not been linked to this sample application before. Delete account if necessary."; - -static NSString *const kFakeDisplayPhotoUrl = -@"https://www.gstatic.com/images/branding/product/1x/play_apps_48dp.png"; - -static NSString *const kFakeDisplayName = @"John GoogleSpeed"; - -static NSString *const kFakeEmail = @"firemail@example.com"; - -static NSString *const kFakePassword = @"fakePassword"; - -@implementation MainViewController (AutoTests) - -- (StaticContentTableViewSection *)autoTestsSection { - __weak typeof(self) weakSelf = self; - return [StaticContentTableViewSection sectionWithTitle:@"Automated Tests" cells:@[ - [StaticContentTableViewCell cellWithTitle:@"BYOAuth" - action:^{ [weakSelf automatedBYOAuth]; }], - [StaticContentTableViewCell cellWithTitle:@"Sign In With Google" - action:^{ [weakSelf automatedSignInGoogle]; }], - [StaticContentTableViewCell cellWithTitle:@"Sign In With Facebook" - action:^{ [weakSelf automatedSignInFacebook]; }], - [StaticContentTableViewCell cellWithTitle:@"Sign Up With Email/Password" - action:^{ [weakSelf automatedEmailSignUp]; }], - [StaticContentTableViewCell cellWithTitle:@"Sign In Anonymously" - action:^{ [weakSelf automatedAnonymousSignIn]; }], - [StaticContentTableViewCell cellWithTitle:@"Link with Google" - action:^{ [weakSelf automatedAccountLinking]; }], - [StaticContentTableViewCell cellWithTitle:@"Sign in With Phone Number" - action:^{ [weakSelf automatedPhoneNumberSignIn]; }] - ]]; -} - -- (void)automatedBYOAuth { - [self log:@"INITIATING AUTOMATED MANUAL TEST FOR BYOAUTH:"]; - [self showSpinner:^{ - NSError *error; - NSString *customToken = [NSString stringWithContentsOfURL:[NSURL URLWithString:kCustomTokenUrl] - encoding:NSUTF8StringEncoding - error:&error]; - NSString *expiredCustomToken = - [NSString stringWithContentsOfURL:[NSURL URLWithString:kExpiredCustomTokenUrl] - encoding:NSUTF8StringEncoding - error:&error]; - [self hideSpinner:^{ - if (error) { - [self log:@"There was an error retrieving the custom token."]; - return; - } - FIRAuth *auth = [AppManager auth]; - [auth signInWithCustomToken:customToken - completion:^(FIRAuthDataResult *_Nullable result, NSError *_Nullable error) { - if (error) { - [self logFailure:@"sign-in with custom token failed" error:error]; - [self logFailedTest:@"A fresh custom token should succeed in signing-in."]; - return; - } - [self logSuccess:@"sign-in with custom token succeeded."]; - [auth.currentUser getIDTokenForcingRefresh:NO - completion:^(NSString *_Nullable token, - NSError *_Nullable error) { - if (error) { - [self logFailure:@"refresh token failed" error:error]; - [self logFailedTest:@"Refresh token should be available."]; - return; - } - [self logSuccess:@"refresh token succeeded."]; - [auth signOut:NULL]; - [auth signInWithCustomToken:expiredCustomToken - completion:^(FIRAuthDataResult *_Nullable result, - NSError *_Nullable error) { - if (!error) { - [self logSuccess:@"sign-in with custom token succeeded."]; - [self logFailedTest:@"sign-in with an expired custom token should NOT succeed."]; - return; - } - [self logFailure:@"sign-in with custom token failed" error:error]; - [auth signInWithCustomToken:kInvalidCustomToken - completion:^(FIRAuthDataResult *_Nullable result, - NSError *_Nullable error) { - if (!error) { - [self logSuccess:@"sign-in with custom token succeeded."]; - [self logFailedTest:@"sign-in with an invalid custom token should NOT succeed."]; - return; - } - [self logFailure:@"sign-in with custom token failed" error:error]; - //next step of automated test. - [self automatedBYOAuthEmailPassword]; - }]; - }]; - }]; - }]; - }]; - }]; -} - -- (void)automatedSignInGoogle { - [self showMessagePromptWithTitle:@"Sign In With Google" - message:kSafariGoogleSignOutMessagePrompt - showCancelButton:NO - completion:^(BOOL userPressedOK, NSString *_Nullable userInput) { - FIRAuth *auth = [AppManager auth]; - if (!auth) { - [self logFailedTest:@"Could not obtain auth object."]; - return; - } - [auth signOut:NULL]; - [self log:@"INITIATING AUTOMATED MANUAL TEST FOR GOOGLE SIGN IN:"]; - [self signInWithProvider:[AuthProviders google] callback:^{ - [self logSuccess:@"sign-in with Google provider succeeded."]; - [auth signOut:NULL]; - [self signInWithProvider:[AuthProviders google] callback:^{ - [self logSuccess:@"sign-in with Google provider succeeded."]; - [self updateEmailPasswordWithCompletion:^{ - [self automatedSignInGoogleDisplayNamePhotoURL]; - }]; - }]; - }]; - }]; -} - -- (void)automatedSignInGoogleDisplayNamePhotoURL { - [self signInWithProvider:[AuthProviders google] callback:^{ - [self updateDisplayNameAndPhotoURlWithCompletion:^{ - [self log:@"FINISHED AUTOMATED MANUAL TEST FOR SIGN-IN WITH GOOGlE."]; - [self reloadUser]; - }]; - }]; -} - -- (void)automatedSignInFacebook { - [self showMessagePromptWithTitle:@"Sign In With Facebook" - message:kSafariFacebookSignOutMessagePrompt - showCancelButton:NO - completion:^(BOOL userPressedOK, NSString *_Nullable userInput) { - FIRAuth *auth = [AppManager auth]; - if (!auth) { - [self logFailedTest:@"Could not obtain auth object."]; - return; - } - [auth signOut:NULL]; - [self log:@"INITIATING AUTOMATED MANUAL TEST FOR FACEBOOK SIGN IN:"]; - [self signInWithProvider:[AuthProviders facebook] callback:^{ - [self logSuccess:@"sign-in with Facebook provider succeeded."]; - [auth signOut:NULL]; - [self signInWithProvider:[AuthProviders facebook] callback:^{ - [self logSuccess:@"sign-in with Facebook provider succeeded."]; - [self updateEmailPasswordWithCompletion:^{ - [self automatedSignInFacebookDisplayNamePhotoURL]; - }]; - }]; - }]; - }]; -} - -- (void)automatedPhoneNumberSignIn { - [self log:@"Automated phone number sign in"]; - FIRAuth *auth = [AppManager auth]; - if (!auth) { - [self logFailedTest:@"Could not obtain auth object."]; - return; - } - [auth signOut:NULL]; - [self log:@"INITIATING AUTOMATED MANUAL TEST FOR PHONE NUMBER SIGN IN:"]; - [self commonPhoneNumberInputWithTitle:@"Phone for automation" - completion:^(NSString *_Nullable phone) { - [self signInWithPhoneNumber:phone completion:^(NSError *error) { - if (error) { - [self logFailedTest:@"Could not sign in with phone number reCAPTCHA."]; - } - [self logSuccess:@"sign-in with phone number reCAPTCHA test succeeded."]; - [auth signOut:NULL]; - [self signInWithPhoneNumber:phone completion:^(NSError *error) { - if (error) { - [self logFailedTest:@"Could not sign in with phone number reCAPTCHA."]; - } - [self logSuccess:@"second sign-in with phone number reCAPTCHA test succeeded."]; - [self updatePhoneNumber:phone completion:^(NSError *error) { - if (error) { - [self logFailedTest:@"Could not update phone number."]; - } - [self logSuccess:@"update phone number test succeeded."]; - [self unlinkFromProvider:FIRPhoneAuthProvider.id completion:^(NSError *error) { - if (error) { - [self logFailedTest:@"Could not unlink phone number."]; - } - [self logSuccess:@"unlink phone number test succeeded."]; - [self linkPhoneNumber:phone completion:^(NSError *error) { - if (error) { - [self logFailedTest:@"Could not link phone number."]; - } - [self logSuccess:@"link phone number test succeeded."]; - [self log:@"FINISHED AUTOMATED MANUAL TEST FOR PHONE NUMBER SIGN IN."]; - }]; - }]; - }]; - }]; - }]; - }]; -} - -- (void)automatedEmailSignUp { - [self log:@"INITIATING AUTOMATED MANUAL TEST FOR FACEBOOK SIGN IN:"]; - FIRAuth *auth = [AppManager auth]; - if (!auth) { - [self logFailedTest:@"Could not obtain auth object."]; - return; - } - [self signUpNewEmail:kFakeEmail password:kFakePassword callback:^(FIRUser *_Nullable user, - NSError *_Nullable error) { - if (error) { - [self logFailedTest: @" Email/Password Account account creation failed"]; - return; - } - [auth signOut:NULL]; - FIRAuthCredential *credential = [FIREmailAuthProvider credentialWithEmail:kFakeEmail - password:kFakePassword]; - [auth signInWithCredential:credential - completion:^(FIRAuthDataResult *_Nullable result, - NSError *_Nullable error) { - if (error) { - [self logFailure:@"sign-in with Email/Password failed" error:error]; - [self logFailedTest:@"sign-in with Email/Password should succeed."]; - return; - } - [self logSuccess:@"sign-in with Email/Password succeeded."]; - [self log:@"FINISHED AUTOMATED MANUAL TEST FOR SIGN-IN WITH EMAIL/PASSWORD."]; - // Delete the user so that we can reuse the fake email address for subsequent tests. - [auth.currentUser deleteWithCompletion:^(NSError *_Nullable error) { - if (error) { - [self logFailure:@"Failed to delete user" error:error]; - [self logFailedTest:@"Deleting a user that was recently signed-in should succeed."]; - return; - } - [self logSuccess:@"User deleted."]; - }]; - }]; - }]; -} - -- (void)automatedAnonymousSignIn { - [self log:@"INITIATING AUTOMATED MANUAL TEST FOR ANONYMOUS SIGN IN:"]; - FIRAuth *auth = [AppManager auth]; - if (!auth) { - [self logFailedTest:@"Could not obtain auth object."]; - return; - } - [auth signOut:NULL]; - [self signInAnonymouslyWithCallback:^(FIRAuthDataResult *_Nullable result, - NSError *_Nullable error) { - if (result.user) { - NSString *anonymousUID = result.user.uid; - [self signInAnonymouslyWithCallback:^(FIRAuthDataResult *_Nullable user, - NSError *_Nullable error) { - if (![result.user.uid isEqual:anonymousUID]) { - [self logFailedTest:@"Consecutive anonymous sign-ins should yeild the same User ID"]; - return; - } - [self log:@"FINISHED AUTOMATED MANUAL TEST FOR ANONYMOUS SIGN IN."]; - }]; - } - }]; -} - -- (void)automatedBYOAuthEmailPassword { - [self showSpinner:^{ - NSError *error; - NSString *customToken = [NSString stringWithContentsOfURL:[NSURL URLWithString:kCustomTokenUrl] - encoding:NSUTF8StringEncoding - error:&error]; - [self hideSpinner:^{ - if (error) { - [self log:@"There was an error retrieving the custom token."]; - return; - } - [[AppManager auth] signInWithCustomToken:customToken - completion:^(FIRAuthDataResult *_Nullable user, - NSError *_Nullable error) { - if (error) { - [self logFailure:@"sign-in with custom token failed" error:error]; - [self logFailedTest:@"A fresh custom token should succeed in signing-in."]; - return; - } - [self logSuccess:@"sign-in with custom token succeeded."]; - [self updateEmailPasswordWithCompletion:^{ - [self automatedBYOAuthDisplayNameAndPhotoURl]; - }]; - }]; - }]; - }]; -} - -- (void)automatedBYOAuthDisplayNameAndPhotoURl { - [self showSpinner:^{ - NSError *error; - NSString *customToken = [NSString stringWithContentsOfURL:[NSURL URLWithString:kCustomTokenUrl] - encoding:NSUTF8StringEncoding - error:&error]; - [self hideSpinner:^{ - if (error) { - [self log:@"There was an error retrieving the custom token."]; - return; - } - [[AppManager auth] signInWithCustomToken:customToken - completion:^(FIRAuthDataResult *_Nullable result, - NSError *_Nullable error) { - if (error) { - [self logFailure:@"sign-in with custom token failed" error:error]; - [self logFailedTest:@"A fresh custom token should succeed in signing-in."]; - return; - } - [self logSuccess:@"sign-in with custom token succeeded."]; - [self updateDisplayNameAndPhotoURlWithCompletion:^{ - [self log:@"FINISHED AUTOMATED MANUAL TEST FOR BYOAUTH."]; - [self reloadUser]; - }]; - }]; - }]; - }]; -} - -- (void)updateEmailPasswordWithCompletion:(void(^)(void))completion { - FIRAuth *auth = [AppManager auth]; - [auth.currentUser updateEmail:kFakeEmail completion:^(NSError *_Nullable error) { - if (error) { - [self logFailure:@"update email failed" error:error]; - [self logFailedTest:@"Update email should succeed when properly signed-in."]; - return; - } - [self logSuccess:@"update email succeeded."]; - [auth.currentUser updatePassword:kFakePassword completion:^(NSError *_Nullable error) { - if (error) { - [self logFailure:@"update password failed" error:error]; - [self logFailedTest:@"Update password should succeed when properly signed-in."]; - return; - } - [self logSuccess:@"update password succeeded."]; - [auth signOut:NULL]; - FIRAuthCredential *credential = - [FIREmailAuthProvider credentialWithEmail:kFakeEmail password:kFakePassword]; - [auth signInWithCredential:credential - completion:^(FIRAuthDataResult *_Nullable result, - NSError *_Nullable error) { - if (error) { - [self logFailure:@"sign-in with Email/Password failed" error:error]; - [self logFailedTest:@"sign-in with Email/Password should succeed."]; - return; - } - [self logSuccess:@"sign-in with Email/Password succeeded."]; - // Delete the user so that we can reuse the fake email address for subsequent tests. - [auth.currentUser deleteWithCompletion:^(NSError *_Nullable error) { - if (error) { - [self logFailure:@"Failed to delete user." error:error]; - [self logFailedTest:@"Deleting a user that was recently signed-in should succeed"]; - return; - } - [self logSuccess:@"User deleted."]; - completion(); - }]; - }]; - }]; - }]; -} - -- (void)updateDisplayNameAndPhotoURlWithCompletion:(void(^)(void))completion { - FIRAuth *auth = [AppManager auth]; - FIRUserProfileChangeRequest *changeRequest = [auth.currentUser profileChangeRequest]; - changeRequest.photoURL = [NSURL URLWithString:kFakeDisplayPhotoUrl]; - [changeRequest commitChangesWithCompletion:^(NSError *_Nullable error) { - if (error) { - [self logFailure:@"set photo URL failed" error:error]; - [self logFailedTest:@"Change photo Url should succeed when signed-in."]; - return; - } - [self logSuccess:@"set PhotoURL succeeded."]; - FIRUserProfileChangeRequest *changeRequest = [auth.currentUser profileChangeRequest]; - changeRequest.displayName = kFakeDisplayName; - [changeRequest commitChangesWithCompletion:^(NSError *_Nullable error) { - if (error) { - [self logFailure:@"set display name failed" error:error]; - [self logFailedTest:@"Change display name should succeed when signed-in."]; - return; - } - [self logSuccess:@"set display name succeeded."]; - completion(); - }]; - }]; -} - -- (void)automatedSignInFacebookDisplayNamePhotoURL { - [self signInWithProvider:[AuthProviders facebook] callback:^{ - [self updateDisplayNameAndPhotoURlWithCompletion:^{ - [self log:@"FINISHED AUTOMATED MANUAL TEST FOR SIGN-IN WITH FACEBOOK."]; - [self reloadUser]; - }]; - }]; -} - -- (void)automatedAccountLinking { - [self log:@"INITIATING AUTOMATED MANUAL TEST FOR ACCOUNT LINKING:"]; - FIRAuth *auth = [AppManager auth]; - if (!auth) { - [self logFailedTest:@"Could not obtain auth object."]; - return; - } - [auth signOut:NULL]; - [self signInAnonymouslyWithCallback:^(FIRAuthDataResult *_Nullable result, - NSError *_Nullable error) { - if (result.user) { - NSString *anonymousUID = result.user.uid; - [self showMessagePromptWithTitle:@"Sign In Instructions" - message:kUnlinkAccountMessagePrompt - showCancelButton:NO - completion:^(BOOL userPressedOK, NSString *_Nullable userInput) { - [[AuthProviders google] - getAuthCredentialWithPresentingViewController:self - callback:^(FIRAuthCredential *credential, - NSError *error) { - if (credential) { - [result.user linkWithCredential:credential completion:^(FIRAuthDataResult *result, - NSError *error) { - FIRUser *user = result.user; - if (error) { - [self logFailure:@"link auth provider failed" error:error]; - [self logFailedTest:@"Account needs to be linked to complete the test."]; - return; - } - [self logSuccess:@"link auth provider succeeded."]; - if (user.isAnonymous) { - [self logFailure:@"link auth provider failed, user still anonymous" error:error]; - [self logFailedTest:@"Account needs to be linked to complete the test."]; - } - if (![user.uid isEqual:anonymousUID]){ - [self logFailedTest:@"link auth provider failed, UID's are different. Make sure " - "you link an account that has NOT been Linked nor Signed-In before."]; - return; - } - [self log:@"FINISHED AUTOMATED MANUAL TEST FOR ACCOUNT LINKING."]; - }]; - } - }]; - }]; - } - }]; -} - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Custom.h b/FirebaseAuth/Tests/Sample/Sample/MainViewController+Custom.h deleted file mode 100644 index d0fb5994061..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Custom.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#import "MainViewController.h" - -#import "StaticContentTableViewManager.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface MainViewController (Custom) - -- (StaticContentTableViewSection *)customAuthSection; - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Custom.m b/FirebaseAuth/Tests/Sample/Sample/MainViewController+Custom.m deleted file mode 100644 index e86e4e87fca..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Custom.m +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "MainViewController+Custom.h" - -#import "AppManager.h" -#import "MainViewController+Internal.h" -#import "CustomTokenDataEntryViewController.h" - -NS_ASSUME_NONNULL_BEGIN - -@implementation MainViewController (Custom) - -- (StaticContentTableViewSection *)customAuthSection { - __weak typeof(self) weakSelf = self; - return [StaticContentTableViewSection sectionWithTitle:@"Custom Auth" cells:@[ - [StaticContentTableViewCell cellWithTitle:@"Sign in with Custom Token" - action:^{ [weakSelf signInWithCustomToken]; }], - ]]; -} - -- (void)signInWithCustomToken { - CustomTokenDataEntryViewControllerCompletion action = - ^(BOOL cancelled, NSString *_Nullable userEnteredTokenText) { - if (cancelled) { - [self log:@"CANCELLED:sign-in with custom token cancelled."]; - return; - } - - [self doSignInWithCustomToken:userEnteredTokenText]; - }; - CustomTokenDataEntryViewController *dataEntryViewController = - [[CustomTokenDataEntryViewController alloc] initWithCompletion:action]; - [self presentViewController:dataEntryViewController animated:YES completion:nil]; -} - -- (void)doSignInWithCustomToken:(NSString *_Nullable)userEnteredTokenText { - [[AppManager auth] signInWithCustomToken:userEnteredTokenText - completion:^(FIRAuthDataResult *_Nullable result, - NSError *_Nullable error) { - if (error) { - [self logFailure:@"sign-in with custom token failed" error:error]; - [self showMessagePromptWithTitle:kSignInErrorAlertTitle - message:error.localizedDescription - showCancelButton:NO - completion:nil]; - return; - } - [self logSuccess:@"sign-in with custom token succeeded."]; - [self showMessagePromptWithTitle:kSignedInAlertTitle - message:result.user.displayName - showCancelButton:NO - completion:nil]; - }]; -} - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Email.h b/FirebaseAuth/Tests/Sample/Sample/MainViewController+Email.h deleted file mode 100644 index d35485e9510..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Email.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#import "MainViewController.h" - -@import FirebaseAuth; -#import "StaticContentTableViewManager.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface MainViewController (Email) - -- (StaticContentTableViewSection *)emailAuthSection; - -// TODO: restore. -typedef void (^FIRAuthResultCallback)(FIRUser *_Nullable user, NSError *_Nullable error); -- (void)signUpNewEmail:(NSString *)email - password:(NSString *)password - callback:(nullable FIRAuthResultCallback)callback; - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Email.m b/FirebaseAuth/Tests/Sample/Sample/MainViewController+Email.m deleted file mode 100644 index 611f5bf9519..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Email.m +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "MainViewController+Email.h" - -#import "AppManager.h" -@import FirebaseAuth; -#import "MainViewController+Internal.h" - -NS_ASSUME_NONNULL_BEGIN - -typedef void (^ShowEmailDialogCompletion)(FIRAuthCredential *credential); - -@implementation MainViewController (Email) - -- (StaticContentTableViewSection *)emailAuthSection { - __weak typeof(self) weakSelf = self; - return [StaticContentTableViewSection sectionWithTitle:@"Email Auth" cells:@[ - [StaticContentTableViewCell cellWithTitle:@"Create User" - action:^{ [weakSelf createUser]; }], - [StaticContentTableViewCell cellWithTitle:@"Sign in with Email Password" - action:^{ [weakSelf signInEmailPassword]; }], - [StaticContentTableViewCell cellWithTitle:@"Link with Email Password" - action:^{ [weakSelf linkWithEmailPassword]; }], - [StaticContentTableViewCell cellWithTitle:@"Reauthenticate Email Password" - action:^{ [weakSelf reauthenticateEmailPassword]; }], - [StaticContentTableViewCell cellWithTitle:@"Send Email Sign in Link" - action:^{ [weakSelf sendEmailSignInLink]; }], - [StaticContentTableViewCell cellWithTitle:@"Sign in with Email Link" - action:^{ [weakSelf signInWithEmailLink]; }], - [StaticContentTableViewCell cellWithTitle:@"Link with Email Link" - action:^{ [weakSelf linkWithEmailLink]; }], - [StaticContentTableViewCell cellWithTitle:@"Unlink from Email" - action:^{ [weakSelf unlinkFromProvider:FIREmailAuthProvider.id - completion:nil]; }], - ]]; -} - -- (void)createUser { - [self showTextInputPromptWithMessage:@"Email:" - keyboardType:UIKeyboardTypeEmailAddress - completionBlock:^(BOOL userPressedOK, NSString *_Nullable email) { - if (!userPressedOK || !email.length) { - return; - } - [self showTextInputPromptWithMessage:@"Password:" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable password) { - if (!userPressedOK) { - return; - } - [self showSpinner:^{ - [[AppManager auth] createUserWithEmail:email - password:password - completion:^(FIRAuthDataResult *_Nullable result, - NSError *_Nullable error) { - if (error) { - [self logFailure:@"create user failed" error:error]; - } else { - [self logSuccess:@"create user succeeded."]; - [self log:result.user.uid]; - } - [self hideSpinner:^{ - [self showTypicalUIForUserUpdateResultsWithTitle:@"Create User" error:error]; - }]; - }]; - }]; - }]; - }]; -} - -- (void)signUpNewEmail:(NSString *)email - password:(NSString *)password - callback:(nullable FIRAuthResultCallback)callback { - [[AppManager auth] createUserWithEmail:email - password:password - completion:^(FIRAuthDataResult *_Nullable result, - NSError *_Nullable error) { - if (error) { - [self logFailure:@"sign-up with Email/Password failed" error:error]; - if (callback) { - callback(nil, error); - } - } else { - [self logSuccess:@"sign-up with Email/Password succeeded."]; - if (callback) { - callback(result.user, nil); - } - } - [self showTypicalUIForUserUpdateResultsWithTitle:@"Sign-In" error:error]; - }]; -} - -- (void)signInEmailPassword { - [self showTextInputPromptWithMessage:@"Email Address" - keyboardType:UIKeyboardTypeEmailAddress - completionBlock:^(BOOL userPressedOK, NSString *_Nullable email) { - if (!userPressedOK || !email.length) { - return; - } - [self showTextInputPromptWithMessage:@"Password" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable password) { - if (!userPressedOK) { - return; - } - [self showSpinner:^{ - [[AppManager auth] signInWithEmail:email - password:password - completion:^(FIRAuthDataResult *_Nullable authResult, - NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - if (error.code == FIRAuthErrorCodeSecondFactorRequired) { - FIRMultiFactorResolver *resolver = error.userInfo[FIRAuthErrors.FIRAuthErrorUserInfoMultiFactorResolverKey]; - NSMutableString *displayNameString = [NSMutableString string]; - for (FIRMultiFactorInfo *tmpFactorInfo in resolver.hints) { - [displayNameString appendString:tmpFactorInfo.displayName]; - [displayNameString appendString:@" "]; - } - [self showTextInputPromptWithMessage:[NSString stringWithFormat:@"Select factor to sign in\n%@", displayNameString] - completionBlock:^(BOOL userPressedOK, NSString *_Nullable displayName) { - FIRPhoneMultiFactorInfo* selectedHint; - for (FIRMultiFactorInfo *tmpFactorInfo in resolver.hints) { - if ([displayName isEqualToString:tmpFactorInfo.displayName]) { - selectedHint = (FIRPhoneMultiFactorInfo *)tmpFactorInfo; - } - } - [FIRPhoneAuthProvider.provider - verifyPhoneNumberWithMultiFactorInfo:selectedHint - UIDelegate:nil - multiFactorSession:resolver.session - completion:^(NSString * _Nullable verificationID, NSError * _Nullable error) { - if (error) { - [self logFailure:@"Multi factor start sign in failed." error:error]; - } else { - [self showTextInputPromptWithMessage:[NSString stringWithFormat:@"Verification code for %@", selectedHint.displayName] - completionBlock:^(BOOL userPressedOK, NSString *_Nullable verificationCode) { - FIRPhoneAuthCredential *credential = - [[FIRPhoneAuthProvider provider] credentialWithVerificationID:verificationID - verificationCode:verificationCode]; - FIRMultiFactorAssertion *assertion = [FIRPhoneMultiFactorGenerator assertionWithCredential:credential]; - [resolver resolveSignInWithAssertion:assertion completion:^(FIRAuthDataResult * _Nullable authResult, NSError * _Nullable error) { - if (error) { - [self logFailure:@"Multi factor finalize sign in failed." error:error]; - } else { - [self logSuccess:@"Multi factor finalize sign in succeeded."]; - } - }]; - }]; - } - }]; - }]; - } else { - [self logFailure:@"sign-in with Email/Password failed" error:error]; - } - } else { - [self logSuccess:@"sign-in with Email/Password succeeded."]; - [self log:[NSString stringWithFormat:@"UID: %@",authResult.user.uid]]; - } - }]; - }]; - }]; - }]; - }]; -} - -- (void)linkWithEmailPassword { - [self showEmailPasswordDialogWithCompletion:^(FIRAuthCredential *credential) { - [self showSpinner:^{ - [[self user] linkWithCredential:credential - completion:^(FIRAuthDataResult *result, NSError *error) { - if (error) { - [self logFailure:@"link Email Password failed." error:error]; - } else { - [self logSuccess:@"link Email Password succeeded."]; - } - [self hideSpinner:^{ - [self showTypicalUIForUserUpdateResultsWithTitle:@"Link with Email Password" error:error]; - }]; - }]; - }]; - }]; -} - -- (void)reauthenticateEmailPassword { - FIRUser *user = [self user]; - if (!user) { - NSString *title = @"Missing User"; - NSString *message = @"There is no signed-in email/password user."; - [self showMessagePromptWithTitle:title message:message showCancelButton:NO completion:nil]; - return; - } - [self showEmailPasswordDialogWithCompletion:^(FIRAuthCredential *credential) { - [self showSpinner:^{ - [[self user] reauthenticateWithCredential:credential - completion:^(FIRAuthDataResult *_Nullable result, - NSError *_Nullable error) { - if (error) { - if (error.code == FIRAuthErrorCodeSecondFactorRequired) { - [self authenticateWithSecondFactorError:error workflow:@"reauthicate"]; - } else { - [self logFailure:@"reauthicate failed" error:error]; - } - } else { - [self logSuccess:@"reauthicate with email password succeeded."]; - } - [self hideSpinner:^{ - [self showTypicalUIForUserUpdateResultsWithTitle:@"Reauthenticate Email Password" error:error]; - }]; - }]; - }]; - }]; -} - -- (void)signInWithEmailLink { - [self showTextInputPromptWithMessage:@"Email Address:" - keyboardType:UIKeyboardTypeEmailAddress - completionBlock:^(BOOL userPressedOK, NSString *_Nullable email) { - if (!userPressedOK || !email.length) { - return; - } - [self showTextInputPromptWithMessage:@"Email Sign-In Link:" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable link) { - if (!userPressedOK) { - return; - } - if ([[FIRAuth auth] isSignInWithEmailLink:link]) { - [self showSpinner:^{ - [[AppManager auth] signInWithEmail:email - link:link - completion:^(FIRAuthDataResult *_Nullable authResult, - NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - if (error.code == FIRAuthErrorCodeSecondFactorRequired) { - [self authenticateWithSecondFactorError:error workflow:@"sign in"]; - } else { - [self logFailure:@"sign-in with Email/Sign-In link failed" error:error]; - } - } else { - [self logSuccess:@"sign-in with Email/Sign-In link succeeded."]; - [self log:[NSString stringWithFormat:@"UID: %@",authResult.user.uid]]; - } - [self showTypicalUIForUserUpdateResultsWithTitle:@"Sign-In Error" error:error]; - }]; - }]; - }]; - } else { - [self log:@"The sign-in link is invalid"]; - } - }]; - }]; -} - -- (void)sendEmailSignInLink { - [self showTextInputPromptWithMessage:@"Email:" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable userInput) { - if (!userPressedOK) { - return; - } - [self showSpinner:^{ - void (^requestEmailSignInLink)(void (^)(NSError *)) = ^(void (^completion)(NSError *)) { - [[AppManager auth] sendSignInLinkToEmail:userInput - actionCodeSettings:[self actionCodeSettings] - completion:completion]; - }; - requestEmailSignInLink(^(NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"Email Link request failed" error:error]; - [self showMessagePrompt:error.localizedDescription]; - return; - } - [self logSuccess:@"Email Link request succeeded."]; - [self showMessagePrompt:@"Sent"]; - }]; - }); - }]; - }]; -} - -- (void)linkWithEmailLink { - [self showEmailLinkDialogWithCompletion:^(FIRAuthCredential *credential) { - [self showSpinner:^{ - [[self user] linkWithCredential:credential - completion:^(FIRAuthDataResult *result, NSError *error) { - if (error) { - [self logFailure:@"link Email Link failed." error:error]; - } else { - [self logSuccess:@"link Email Link succeeded."]; - } - [self hideSpinner:^{ - [self showTypicalUIForUserUpdateResultsWithTitle:@"Link with Email Link" error:error]; - }]; - }]; - }]; - }]; -} - -- (void)showEmailPasswordDialogWithCompletion:(ShowEmailDialogCompletion)completion { - [self showTextInputPromptWithMessage:@"Email Address:" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable email) { - if (!userPressedOK || !email.length) { - return; - } - [self showTextInputPromptWithMessage:@"Password:" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable password) { - if (!userPressedOK || !password.length) { - return; - } - FIRAuthCredential *credential = [FIREmailAuthProvider credentialWithEmail:email - password:password]; - completion(credential); - }]; - }]; -} - -- (void)showEmailLinkDialogWithCompletion:(ShowEmailDialogCompletion)completion { - [self showTextInputPromptWithMessage:@"Email Address:" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable email) { - if (!userPressedOK || !email.length) { - return; - } - [self showTextInputPromptWithMessage:@"Link:" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable link) { - if (!userPressedOK || !link.length) { - return; - } - FIRAuthCredential *credential = [FIREmailAuthProvider credentialWithEmail:email - link:link]; - completion(credential); - }]; - }]; -} - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Facebook.h b/FirebaseAuth/Tests/Sample/Sample/MainViewController+Facebook.h deleted file mode 100644 index 18aa7d12b7a..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Facebook.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#import "MainViewController.h" - -#import "StaticContentTableViewManager.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface MainViewController (Facebook) - -- (StaticContentTableViewSection *)facebookAuthSection; - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Facebook.m b/FirebaseAuth/Tests/Sample/Sample/MainViewController+Facebook.m deleted file mode 100644 index 778d010141e..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Facebook.m +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "MainViewController+Facebook.h" - -#import "AuthProviders.h" -#import "MainViewController+Internal.h" - -NS_ASSUME_NONNULL_BEGIN - -@implementation MainViewController (Facebook) - -- (StaticContentTableViewSection *)facebookAuthSection { - __weak typeof(self) weakSelf = self; - return [StaticContentTableViewSection sectionWithTitle:@"Facebook Auth" cells:@[ - [StaticContentTableViewCell cellWithTitle:@"Sign in with Facebook" - action:^{ [weakSelf signInFacebook]; }], - [StaticContentTableViewCell cellWithTitle:@"Link with Facebook" - action:^{ [weakSelf linkWithFacebook]; }], - [StaticContentTableViewCell cellWithTitle:@"Unlink from Facebook" - action:^{ - [weakSelf unlinkFromProvider:FIRFacebookAuthProvider.id completion:nil]; - }], - [StaticContentTableViewCell cellWithTitle:@"Reauthenticate Facebook" - action:^{ [weakSelf reauthenticateFacebook]; }], - ]]; -} - -- (void)signInFacebook { - [self signinWithProvider:[AuthProviders facebook] retrieveData:YES]; -} - -- (void)linkWithFacebook { - [self linkWithAuthProvider:[AuthProviders facebook] retrieveData:NO]; -} - -- (void)reauthenticateFacebook { - [self reauthenticate:[AuthProviders facebook] retrieveData:NO]; -} - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+GameCenter.h b/FirebaseAuth/Tests/Sample/Sample/MainViewController+GameCenter.h deleted file mode 100644 index 85b5485aebf..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+GameCenter.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import -#import - -#import "MainViewController.h" - -#import "StaticContentTableViewManager.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface MainViewController (GameCenter) - -- (StaticContentTableViewSection *)gameCenterAuthSection; - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+GameCenter.m b/FirebaseAuth/Tests/Sample/Sample/MainViewController+GameCenter.m deleted file mode 100644 index 3887d413046..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+GameCenter.m +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "MainViewController+GameCenter.h" - -#import "AppManager.h" -#import -#import "MainViewController+Internal.h" - -NS_ASSUME_NONNULL_BEGIN - -@implementation MainViewController (GameCenter) - -- (StaticContentTableViewSection *)gameCenterAuthSection { - __weak typeof(self) weakSelf = self; - return [StaticContentTableViewSection sectionWithTitle:@"Game Center Auth" cells:@[ - [StaticContentTableViewCell cellWithTitle:@"Log in System Game Center" - action:^{ [weakSelf logInWithSystemGameCenter]; }], - [StaticContentTableViewCell cellWithTitle:@"Sign in Game Center" - action:^{ [weakSelf signInWithGameCenter]; }], - [StaticContentTableViewCell cellWithTitle:@"Link Game Center" - action:^{ [weakSelf linkWithGameCenter]; }], - [StaticContentTableViewCell cellWithTitle:@"Unlink Game Center" - action:^{ [weakSelf unlinkFromProvider:FIRGameCenterAuthProvider.id completion:nil]; }], - [StaticContentTableViewCell cellWithTitle:@"Reauthenticate Game Center" - action:^{ [weakSelf reauthenticateWithGameCenter]; }], - ]]; -} - -- (void)logInWithSystemGameCenter { - GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer]; - localPlayer.authenticateHandler = ^(UIViewController * _Nullable viewController, - NSError * _Nullable error) { - if (error) { - [self showTypicalUIForUserUpdateResultsWithTitle:@"Game Center Error" error:error]; - } else if (viewController != nil) { - [self presentViewController:viewController animated:YES completion:nil]; - } - }; -} - -- (void)signInWithGameCenter { - [FIRGameCenterAuthProvider getCredentialWithCompletion: - ^(FIRAuthCredential * _Nullable credential, NSError * _Nullable error) { - if (error) { - [self showTypicalUIForUserUpdateResultsWithTitle:@"Game Center Error" error:error]; - } else { - [[AppManager auth] signInWithCredential:credential - completion:^(FIRAuthDataResult * _Nullable result, - NSError * _Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"Sign in with Game Center failed" error:error]; - } else { - [self logSuccess:@"Sign in with Game Center succeeded."]; - } - [self showTypicalUIForUserUpdateResultsWithTitle:@"Sign In Error" error:error]; - }]; - }]; - } - }]; -} - -- (void)linkWithGameCenter { - [FIRGameCenterAuthProvider getCredentialWithCompletion: - ^(FIRAuthCredential * _Nullable credential, NSError * _Nullable error) { - if (error) { - [self showTypicalUIForUserUpdateResultsWithTitle:@"Game Center Error" error:error]; - } else { - [[self user] linkWithCredential:credential - completion:^(FIRAuthDataResult * _Nullable result, - NSError * _Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"Link with Game Center failed" error:error]; - } else { - [self logSuccess:@"Link with Game Center succeeded."]; - } - [self showTypicalUIForUserUpdateResultsWithTitle:@"Link Error" error:error]; - }]; - }]; - } - }]; -} - -- (void)reauthenticateWithGameCenter { - [FIRGameCenterAuthProvider getCredentialWithCompletion: - ^(FIRAuthCredential * _Nullable credential, NSError * _Nullable error) { - if (error) { - [self showTypicalUIForUserUpdateResultsWithTitle:@"Game Center Error" error:error]; - } else { - [[self user] reauthenticateWithCredential:credential - completion:^(FIRAuthDataResult * _Nullable result, - NSError * _Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"Reauthenticate with Game Center failed" error:error]; - } else { - [self logSuccess:@"Reauthenticate with Game Center succeeded."]; - } - [self showTypicalUIForUserUpdateResultsWithTitle:@"Reauthenticate Error" error:error]; - }]; - }]; - } - }]; -} - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Google.h b/FirebaseAuth/Tests/Sample/Sample/MainViewController+Google.h deleted file mode 100644 index ef941148906..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Google.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#import "MainViewController.h" - -#import "StaticContentTableViewManager.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface MainViewController (Google) - -- (StaticContentTableViewSection *)googleAuthSection; - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Google.m b/FirebaseAuth/Tests/Sample/Sample/MainViewController+Google.m deleted file mode 100644 index 3679e2d0c92..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Google.m +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "MainViewController+Google.h" - -#import "AppManager.h" -#import "AuthProviders.h" -#import "MainViewController+Internal.h" -@import FirebaseAuth; - -typedef void (^FIRAuthDataResultCallback)(FIRAuthDataResult *_Nullable authResult, - NSError *_Nullable error); - -NS_ASSUME_NONNULL_BEGIN - -@implementation MainViewController (Google) - -- (StaticContentTableViewSection *)googleAuthSection { - __weak typeof(self) weakSelf = self; - return [StaticContentTableViewSection sectionWithTitle:@"Google Auth" cells:@[ - [StaticContentTableViewCell cellWithTitle:@"Sign in with Google" - action:^{ [weakSelf signInGoogle]; }], - [StaticContentTableViewCell cellWithTitle:@"Link with Google" - action:^{ [weakSelf linkWithGoogle]; }], - [StaticContentTableViewCell cellWithTitle:@"Unlink from Google" - action:^{ [weakSelf unlinkFromProvider:FIRGoogleAuthProvider.id completion:nil]; }], - [StaticContentTableViewCell cellWithTitle:@"Reauthenticate Google" - action:^{ [weakSelf reauthenticateGoogle]; }], - ]]; -} - -- (void)signInGoogle { - FIRAuth *auth = [AppManager auth]; - if (!auth) { - return; - } - [[AuthProviders google] getAuthCredentialWithPresentingViewController:self - callback:^(FIRAuthCredential *credential, - NSError *error) { - if (credential) { - FIRAuthDataResultCallback completion = ^(FIRAuthDataResult *_Nullable authResult, - NSError *_Nullable error) { - if (error) { - if (error.code == FIRAuthErrorCodeSecondFactorRequired) { - FIRMultiFactorResolver *resolver = error.userInfo[FIRAuthErrors.FIRAuthErrorUserInfoMultiFactorResolverKey]; - NSMutableString *displayNameString = [NSMutableString string]; - for (FIRMultiFactorInfo *tmpFactorInfo in resolver.hints) { - [displayNameString appendString:tmpFactorInfo.displayName]; - [displayNameString appendString:@" "]; - } - [self showTextInputPromptWithMessage:[NSString stringWithFormat:@"Select factor to sign in\n%@", displayNameString] - completionBlock:^(BOOL userPressedOK, NSString *_Nullable displayName) { - FIRPhoneMultiFactorInfo* selectedHint; - for (FIRMultiFactorInfo *tmpFactorInfo in resolver.hints) { - if ([displayName isEqualToString:tmpFactorInfo.displayName]) { - selectedHint = (FIRPhoneMultiFactorInfo *)tmpFactorInfo; - } - } - [FIRPhoneAuthProvider.provider - verifyPhoneNumberWithMultiFactorInfo:selectedHint - UIDelegate:nil - multiFactorSession:resolver.session - completion:^(NSString * _Nullable verificationID, NSError * _Nullable error) { - if (error) { - [self logFailure:@"Multi factor start sign in failed." error:error]; - } else { - [self showTextInputPromptWithMessage:[NSString stringWithFormat:@"Verification code for %@", selectedHint.displayName] - completionBlock:^(BOOL userPressedOK, NSString *_Nullable verificationCode) { - FIRPhoneAuthCredential *credential = - [[FIRPhoneAuthProvider provider] credentialWithVerificationID:verificationID - verificationCode:verificationCode]; - FIRMultiFactorAssertion *assertion = [FIRPhoneMultiFactorGenerator assertionWithCredential:credential]; - [resolver resolveSignInWithAssertion:assertion completion:^(FIRAuthDataResult * _Nullable authResult, NSError * _Nullable error) { - if (error) { - [self logFailure:@"Multi factor finalize sign in failed." error:error]; - } else { - [self logSuccess:@"Multi factor finalize sign in succeeded."]; - } - }]; - }]; - } - }]; - }]; - } else { - [self logFailure:@"sign-in with provider failed" error:error]; - } - } else { - [self logSuccess:@"sign-in with provider succeeded."]; - } - if (authResult.additionalUserInfo) { - [self logSuccess:[self stringWithAdditionalUserInfo:authResult.additionalUserInfo]]; - if (self.isNewUserToggleOn) { - NSString *newUserString = authResult.additionalUserInfo.isNewUser ? - @"New user" : @"Existing user"; - [self showMessagePromptWithTitle:@"New or Existing" - message:newUserString - showCancelButton:NO - completion:nil]; - } - } - }; - [auth signInWithCredential:credential completion:completion]; - } - }]; -} - -- (void)linkWithGoogle { - [self linkWithAuthProvider:[AuthProviders google] retrieveData:NO]; -} - -- (void)reauthenticateGoogle { - [self reauthenticate:[AuthProviders google] retrieveData:NO]; -} - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Internal.h b/FirebaseAuth/Tests/Sample/Sample/MainViewController+Internal.h deleted file mode 100644 index 447020d7e30..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Internal.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#import "MainViewController.h" - -@import FirebaseAuth; -#import "UIViewController+Alerts.h" -#import "AuthProviders.h" - -NS_ASSUME_NONNULL_BEGIN - -static NSString *const kSignedInAlertTitle = @"Signed In"; - -static NSString *const kSignInErrorAlertTitle = @"Sign-In Error"; - -/** @brief The request type for OOB action codes. - */ -typedef enum { - /** No action code settings. */ - ActionCodeRequestTypeEmail, - /** With continue URL but not handled in-app. */ - ActionCodeRequestTypeContinue, - /** Handled in-app. */ - ActionCodeRequestTypeInApp, -} ActionCodeRequestType; - -typedef void (^TextInputCompletionBlock)(NSString *_Nullable userInput); - -typedef void (^TestAutomationCallback)(NSError *_Nullable error); - -@interface MainViewController () - -@property(nonatomic) BOOL isNewUserToggleOn; - -@property(nonatomic) ActionCodeRequestType actionCodeRequestType; - -@property(nonatomic) NSURL *actionCodeContinueURL; - -@property(nonatomic, copy) NSString *appleRawNonce; - -@property(nonatomic) FIROAuthProvider *googleOAuthProvider; -@property(nonatomic) FIROAuthProvider *microsoftOAuthProvider; -@property(nonatomic) FIROAuthProvider *twitterOAuthProvider; -@property(nonatomic) FIROAuthProvider *linkedinOAuthProvider; -@property(nonatomic) FIROAuthProvider *yahooOAuthProvider; -@property(nonatomic) FIROAuthProvider *gitHubOAuthProvider; - -// TODO: Restore FIRAuthStateDidChangeListenerHandle for CocoaPods. -@property(nonatomic) NSMutableArray> *authStateDidChangeListeners; - -@property(nonatomic) NSMutableArray> *IDTokenDidChangeListeners; - -- (void)updateTable; - -- (FIRUser *)user; - -- (void)signinWithProvider:(id)authProvider retrieveData:(BOOL)retrieveData; - -- (void)signInWithProvider:(nonnull id)provider callback:(void(^)(void))callback; - -- (void)linkWithAuthProvider:(id)authProvider retrieveData:(BOOL)retrieveData; - -- (void)unlinkFromProvider:(NSString *)provider - completion:(nullable TestAutomationCallback)completion; - -- (void)reauthenticate:(id)authProvider retrieveData:(BOOL)retrieveData; - -- (void)log:(NSString *)string; - -- (void)logSuccess:(NSString *)string; - -- (void)logFailure:(NSString *)string error:(NSError * _Nullable) error; - -- (void)logFailedTest:(NSString *)reason; - -- (NSString *)stringWithAdditionalUserInfo:(nullable FIRAdditionalUserInfo *)additionalUserInfo; - -- (void)showTypicalUIForUserUpdateResultsWithTitle:(NSString *)resultsTitle - error:(NSError * _Nullable)error; - -- (FIRActionCodeSettings *)actionCodeSettings; - -- (void)authenticateWithSecondFactorError:(NSError * _Nullable)error - workflow:(NSString *)workflow; - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+MultiFactor.h b/FirebaseAuth/Tests/Sample/Sample/MainViewController+MultiFactor.h deleted file mode 100644 index 97bd9c38dab..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+MultiFactor.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#import "MainViewController.h" - -#import "StaticContentTableViewManager.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface MainViewController (MultiFactor) - -- (StaticContentTableViewSection *)multiFactorSection; - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+MultiFactor.m b/FirebaseAuth/Tests/Sample/Sample/MainViewController+MultiFactor.m deleted file mode 100644 index 19b363b8270..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+MultiFactor.m +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "MainViewController+MultiFactor.h" - -@import FirebaseAuth; -#import "MainViewController+Internal.h" -#import - -NS_ASSUME_NONNULL_BEGIN - -@implementation MainViewController (MultiFactor) - -- (StaticContentTableViewSection *)multiFactorSection { - __weak typeof(self) weakSelf = self; - return [StaticContentTableViewSection sectionWithTitle:@"Multi Factor" cells:@[ - [StaticContentTableViewCell cellWithTitle:@"Phone Enroll" - action:^{ [weakSelf phoneEnroll]; }], - [StaticContentTableViewCell cellWithTitle:@"TOTP Enroll" - action:^{ [weakSelf TOTPEnroll]; }], - [StaticContentTableViewCell cellWithTitle:@"MultiFactor Unenroll" - action:^{ [weakSelf mfaUnenroll]; }], - ]]; -} - -- (void)phoneEnroll { - FIRUser *user = FIRAuth.auth.currentUser; - if (!user) { - [self logFailure:@"Please sign in first." error:nil]; - return; - } - [self showTextInputPromptWithMessage:@"Phone Number" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable phoneNumber) { - [user.multiFactor - getSessionWithCompletion:^(FIRMultiFactorSession *_Nullable session, NSError *_Nullable error) { - // this is the step verfication code has been send to the phone number along with validating the number - [FIRPhoneAuthProvider.provider verifyPhoneNumber:phoneNumber - UIDelegate:nil - multiFactorSession:session - completion:^(NSString * _Nullable verificationID, - NSError * _Nullable error) { - if (error) { - [self logFailure:@"Multi factor start enroll failed." error:error]; - } else { - [self showTextInputPromptWithMessage:@"Verification code" - completionBlock:^(BOOL userPressedOK, - NSString *_Nullable verificationCode) { - FIRPhoneAuthCredential *credential = - [[FIRPhoneAuthProvider provider] credentialWithVerificationID:verificationID - verificationCode:verificationCode]; - FIRMultiFactorAssertion *assertion = - [FIRPhoneMultiFactorGenerator assertionWithCredential:credential]; - [self showTextInputPromptWithMessage:@"Display name" - completionBlock:^(BOOL userPressedOK, - NSString *_Nullable displayName) { - [user.multiFactor enrollWithAssertion:assertion - displayName:displayName - completion:^(NSError *_Nullable error) { - if (error) { - [self logFailure:@"Multi factor finalize enroll failed." error:error]; - } else { - [self logSuccess:@"Multi factor finalize enroll succeeded."]; - } - }]; - }]; - }]; - } - }]; - }]; - }]; -} - -- (void)TOTPEnroll { - FIRUser *user = FIRAuth.auth.currentUser; - if (!user) { - [self logFailure:@"Please sign in first." error:nil]; - return; - } - [user.multiFactor getSessionWithCompletion:^(FIRMultiFactorSession *_Nullable session, NSError *_Nullable error) { - if (error) { - [self logFailure:@"Error getting multi-factor session." error:error]; - return; - } - [FIRTOTPMultiFactorGenerator generateSecretWithMultiFactorSession:session completion:^(FIRTOTPSecret *_Nullable secret, NSError *_Nullable error) { - if (error) { - [self logFailure:@"Error generating TOTP secret." error:error]; - return; - } - NSString *accountName = user.email; - NSString *issuer = FIRAuth.auth.app.name; - dispatch_async(dispatch_get_main_queue(), ^{ - NSString *url = [secret generateQRCodeURLWithAccountName:accountName issuer:issuer]; - if(!url.length) { - [self logFailure: @"Multi factor finalize enroll failed. Could not generate url." error:nil]; - return; - } - [secret openInOTPAppWithQRCodeURL:url]; - [self showQRCodePromptWithTextInput:@"Scan this QR Code and enter OTP:" - qrCodeString:url - completionBlock:^(BOOL userPressedOK, NSString *_Nullable oneTimePassword) { - FIRTOTPMultiFactorAssertion *assertion = [FIRTOTPMultiFactorGenerator assertionForEnrollmentWithSecret:secret oneTimePassword:oneTimePassword]; - [self showTextInputPromptWithMessage:@"Display name" - completionBlock:^(BOOL userPressedOK, - NSString *_Nullable displayName) { - [user.multiFactor enrollWithAssertion:assertion - displayName:displayName - completion:^(NSError *_Nullable error) { - if (error) { - [self logFailure:@"Multi factor finalize enroll failed." error:error]; - } else { - [self logSuccess:@"Multi factor finalize enroll succeeded."]; - } - }]; - }]; - }]; - }); - }]; - }]; -} - -- (void)mfaUnenroll { - NSMutableString *displayNameString = [NSMutableString string]; - for (FIRMultiFactorInfo *tmpFactorInfo in FIRAuth.auth.currentUser.multiFactor.enrolledFactors) { - [displayNameString appendString:tmpFactorInfo.displayName]; - [displayNameString appendString:@" "]; - } - [self showTextInputPromptWithMessage:[NSString stringWithFormat:@"Enter multi factor to unenroll\n%@", displayNameString] - completionBlock:^(BOOL userPressedOK, NSString *_Nullable displayName) { - FIRMultiFactorInfo *factorInfo; - for (FIRMultiFactorInfo *tmpFactorInfo in FIRAuth.auth.currentUser.multiFactor.enrolledFactors) { - if ([displayName isEqualToString:tmpFactorInfo.displayName]) { - factorInfo = tmpFactorInfo; - } - } - [FIRAuth.auth.currentUser.multiFactor unenrollWithInfo:factorInfo - completion:^(NSError * _Nullable error) { - if (error) { - [self logFailure:@"Multi factor unenroll failed." error:error]; - } else { - [self logSuccess:@"Multi factor unenroll succeeded."]; - } - }]; - }]; -} - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+OAuth.h b/FirebaseAuth/Tests/Sample/Sample/MainViewController+OAuth.h deleted file mode 100644 index f487050c6a0..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+OAuth.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#import "MainViewController.h" - -#import "StaticContentTableViewManager.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface MainViewController (OAuth) - -- (StaticContentTableViewSection *)oAuthSection; - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+OAuth.m b/FirebaseAuth/Tests/Sample/Sample/MainViewController+OAuth.m deleted file mode 100644 index e5ae479ca9c..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+OAuth.m +++ /dev/null @@ -1,493 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@import CommonCrypto; - -#import "MainViewController+OAuth.h" - -#import - -#import "AppManager.h" -@import FirebaseAuth; -#import "MainViewController+Internal.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface MainViewController () - -@end - -@implementation MainViewController (OAuth) - -- (StaticContentTableViewSection *)oAuthSection { - __weak typeof(self) weakSelf = self; - return [StaticContentTableViewSection sectionWithTitle:@"OAuth" cells:@[ - [StaticContentTableViewCell cellWithTitle:@"Sign in with Google" - action:^{ [weakSelf signInGoogleHeadfulLite]; }], - [StaticContentTableViewCell cellWithTitle:@"Link with Google" - action:^{ [weakSelf linkWithGoogleHeadfulLite]; }], - [StaticContentTableViewCell cellWithTitle:@"Reauthenticate with Google" - action:^{ [weakSelf reauthenticateWithGoogleHeadfulLite]; }], - [StaticContentTableViewCell cellWithTitle:@"Sign in with Apple" - action:^{ [weakSelf signInWithApple]; }], - [StaticContentTableViewCell cellWithTitle:@"Link with Apple" - action:^{ [weakSelf linkWithApple]; }], - [StaticContentTableViewCell cellWithTitle:@"Unlink with Apple" - action:^{ [weakSelf unlinkFromProvider:@"apple.com" completion:nil]; }], - [StaticContentTableViewCell cellWithTitle:@"Reauthenticate with Apple" - action:^{ [weakSelf reauthenticateWithApple]; }], - [StaticContentTableViewCell cellWithTitle:@"Revoke Apple Token and Delete User" - action:^{ [weakSelf revokeAppleTokenAndDeleteUser]; }], - [StaticContentTableViewCell cellWithTitle:@"Sign in with Twitter" - action:^{ [weakSelf signInTwitterHeadfulLite]; }], - [StaticContentTableViewCell cellWithTitle:@"Sign in with GitHub" - action:^{ [weakSelf signInGitHubHeadfulLite]; }], - [StaticContentTableViewCell cellWithTitle:@"Sign in with GitHub (Access token)" - action:^{ [weakSelf signInWithGitHub]; }], - [StaticContentTableViewCell cellWithTitle:@"Sign in with Microsoft" - action:^{ [weakSelf signInMicrosoftHeadfulLite]; }], - [StaticContentTableViewCell cellWithTitle:@"Sign in with Yahoo" - action:^{ [weakSelf signInYahooHeadfulLite]; }], - [StaticContentTableViewCell cellWithTitle:@"Sign in with Linkedin" - action:^{ [weakSelf signInLinkedinHeadfulLite]; }], - ]]; -} - -- (void)signInGoogleHeadfulLite { - FIROAuthProvider *provider = self.googleOAuthProvider; - provider.customParameters = @{ - @"prompt" : @"consent", - }; - provider.scopes = @[ @"profile", @"email", @"https://www.googleapis.com/auth/plus.me" ]; - [self showSpinner:^{ - [[AppManager auth] signInWithProvider:provider - UIDelegate:nil - completion:^(FIRAuthDataResult *_Nullable authResult, - NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"sign-in with provider (Google) failed" error:error]; - } else if (authResult.additionalUserInfo) { - [self logSuccess:[self stringWithAdditionalUserInfo:authResult.additionalUserInfo]]; - if (self.isNewUserToggleOn) { - NSString *newUserString = authResult.additionalUserInfo.newUser ? - @"New user" : @"Existing user"; - [self showMessagePromptWithTitle:@"New or Existing" - message:newUserString - showCancelButton:NO - completion:nil]; - } - } - [self showTypicalUIForUserUpdateResultsWithTitle:@"Sign-In Error" error:error]; - }]; - }]; - }]; -} - -- (void)linkWithGoogleHeadfulLite { - FIROAuthProvider *provider = self.googleOAuthProvider; - provider.customParameters = @{ - @"prompt" : @"consent", - }; - provider.scopes = @[ @"profile", @"email", @"https://www.googleapis.com/auth/plus.me" ]; - [self showSpinner:^{ - [[AppManager auth].currentUser linkWithProvider:provider - UIDelegate:nil - completion:^(FIRAuthDataResult *_Nullable authResult, - NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"Reauthenticate with provider (Google) failed" error:error]; - } else if (authResult.additionalUserInfo) { - [self logSuccess:[self stringWithAdditionalUserInfo:authResult.additionalUserInfo]]; - if (self.isNewUserToggleOn) { - NSString *newUserString = authResult.additionalUserInfo.newUser ? - @"New user" : @"Existing user"; - [self showMessagePromptWithTitle:@"New or Existing" - message:newUserString - showCancelButton:NO - completion:nil]; - } - } - [self showTypicalUIForUserUpdateResultsWithTitle:@"Link Error" error:error]; - }]; - }]; - }]; -} - -- (void)reauthenticateWithGoogleHeadfulLite { - FIROAuthProvider *provider = self.googleOAuthProvider; - provider.customParameters = @{ - @"prompt" : @"consent", - }; - provider.scopes = @[ @"profile", @"email", @"https://www.googleapis.com/auth/plus.me" ]; - [self showSpinner:^{ - [[AppManager auth].currentUser reauthenticateWithProvider:provider - UIDelegate:nil - completion:^(FIRAuthDataResult *_Nullable authResult, - NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"Link with provider (Google) failed" error:error]; - } else if (authResult.additionalUserInfo) { - [self logSuccess:[self stringWithAdditionalUserInfo:authResult.additionalUserInfo]]; - if (self.isNewUserToggleOn) { - NSString *newUserString = authResult.additionalUserInfo.newUser ? - @"New user" : @"Existing user"; - [self showMessagePromptWithTitle:@"New or Existing" - message:newUserString - showCancelButton:NO - completion:nil]; - } - } - [self showTypicalUIForUserUpdateResultsWithTitle:@"Reauthenticate Error" error:error]; - }]; - }]; - }]; -} - -- (void)signInTwitterHeadfulLite { - FIROAuthProvider *provider = self.twitterOAuthProvider; - [self showSpinner:^{ - [provider getCredentialWithUIDelegate:nil completion:^(FIRAuthCredential *_Nullable credential, - NSError *_Nullable error) { - if (error) { - [self logFailure:@"sign-in with Twitter failed" error:error]; - return; - } - [[AppManager auth] signInWithCredential:credential - completion:^(FIRAuthDataResult *_Nullable - authResult, - NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"sign-in with Twitter (headful-lite) failed" error:error]; - return; - } else { - [self logSuccess:@"sign-in with Twitter (headful-lite) succeeded."]; - } - [self showTypicalUIForUserUpdateResultsWithTitle:@"Sign-In Error" error:error]; - }]; - }]; - }]; - }]; -} - -- (void)signInWithGitHub { - [self showTextInputPromptWithMessage:@"GitHub Access Token:" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable accessToken) { - if (!userPressedOK || !accessToken.length) { - return; - } - FIROAuthCredential *credential = - [FIROAuthProvider credentialWithProviderID:FIRGitHubAuthProvider.id accessToken:accessToken]; - if (credential) { - [[AppManager auth] signInWithCredential:credential - completion:^(FIRAuthDataResult *_Nullable result, - NSError *_Nullable error) { - if (error) { - [self logFailure:@"sign-in with provider failed" error:error]; - } else { - [self logSuccess:@"sign-in with provider succeeded."]; - } - [self showTypicalUIForUserUpdateResultsWithTitle:@"Sign-In" error:error]; - }]; - } - }]; -} - -- (void)signInGitHubHeadfulLite { - FIROAuthProvider *provider = self.gitHubOAuthProvider; - [self showSpinner:^{ - [provider getCredentialWithUIDelegate:nil completion:^(FIRAuthCredential *_Nullable credential, - NSError *_Nullable error) { - if (error) { - [self logFailure:@"sign-in with GitHub failed" error:error]; - return; - } - [[AppManager auth] signInWithCredential:credential - completion:^(FIRAuthDataResult *_Nullable - authResult, - NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"sign-in with GitHub (headful-lite) failed" error:error]; - return; - } else { - [self logSuccess:@"sign-in with GitHub (headful-lite) succeeded."]; - } - [self showTypicalUIForUserUpdateResultsWithTitle:@"Sign-In Error" error:error]; - }]; - }]; - }]; - }]; -} - -- (void)signInLinkedinHeadfulLite { - FIROAuthProvider *provider = self.linkedinOAuthProvider; - [self showSpinner:^{ - [provider getCredentialWithUIDelegate:nil completion:^(FIRAuthCredential *_Nullable credential, - NSError *_Nullable error) { - if (error) { - [self logFailure:@"sign-in with Linkedin failed" error:error]; - return; - } - [[AppManager auth] signInWithCredential:credential - completion:^(FIRAuthDataResult *_Nullable - authResult, - NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"sign-in with Linkedin (headful-lite) failed" error:error]; - return; - } else { - [self logSuccess:@"sign-in with Linkedin (headful-lite) succeeded."]; - } - [self showTypicalUIForUserUpdateResultsWithTitle:@"Sign-In Error" error:error]; - }]; - }]; - }]; - }]; -} - -- (void)signInMicrosoftHeadfulLite { - FIROAuthProvider *provider = self.microsoftOAuthProvider; - provider.customParameters = @{ - @"prompt" : @"consent", - @"login_hint" : @"tu8731@gmail.com", - }; - provider.scopes = @[ @"user.readwrite,calendars.read" ]; - [self showSpinner:^{ - [provider getCredentialWithUIDelegate:nil completion:^(FIRAuthCredential *_Nullable credential, - NSError *_Nullable error) { - if (error) { - [self logFailure:@"sign-in with Microsoft failed" error:error]; - return; - } - [[AppManager auth] signInWithCredential:credential - completion:^(FIRAuthDataResult *_Nullable - authResult, - NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"sign-in with Microsoft failed" error:error]; - return; - } else { - [self logSuccess:@"sign-in with Microsoft (headful-lite) succeeded."]; - } - [self showTypicalUIForUserUpdateResultsWithTitle:@"Sign-In Error" error:error]; - }]; - }]; - }]; - }]; -} - -- (void)signInYahooHeadfulLite { - FIROAuthProvider *provider = self.yahooOAuthProvider; - [self showSpinner:^{ - [provider getCredentialWithUIDelegate:nil completion:^(FIRAuthCredential *_Nullable credential, - NSError *_Nullable error) { - if (error) { - [self logFailure:@"sign-in with Yahoo failed" error:error]; - return; - } - [[AppManager auth] signInWithCredential:credential - completion:^(FIRAuthDataResult *_Nullable - authResult, - NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"sign-in with Yahoo (headful-lite) failed" error:error]; - return; - } else { - [self logSuccess:@"sign-in with Yahoo (headful-lite) succeeded."]; - } - [self showTypicalUIForUserUpdateResultsWithTitle:@"Sign-In Error" error:error]; - }]; - }]; - }]; - }]; -} - -- (ASAuthorizationAppleIDRequest *)appleIDRequestWithState:(NSString *)state API_AVAILABLE(ios(13.0)) { - ASAuthorizationAppleIDRequest *request = [[[ASAuthorizationAppleIDProvider alloc] init] createRequest]; - request.requestedScopes = @[ASAuthorizationScopeEmail, ASAuthorizationScopeFullName]; - NSString *rawNonce = [self randomNonce:32]; - self.appleRawNonce = rawNonce; - request.nonce = [self stringBySha256HashingString:rawNonce]; - request.state = state; - return request; -} - -- (NSString *)randomNonce:(NSInteger)length { - NSAssert(length > 0, @"Expected nonce to have positive length"); - NSString *characterSet = @"0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._"; - NSMutableString *result = [NSMutableString string]; - NSInteger remainingLength = length; - - while (remainingLength > 0) { - NSMutableArray *randoms = [NSMutableArray arrayWithCapacity:16]; - for (NSInteger i = 0; i < 16; i++) { - uint8_t random = 0; - int errorCode = SecRandomCopyBytes(kSecRandomDefault, 1, &random); - NSAssert(errorCode == errSecSuccess, @"Unable to generate nonce: OSStatus %i", errorCode); - - [randoms addObject:@(random)]; - } - - for (NSNumber *random in randoms) { - if (remainingLength == 0) { - break; - } - - if (random.unsignedIntValue < characterSet.length) { - unichar character = [characterSet characterAtIndex:random.unsignedIntValue]; - [result appendFormat:@"%C", character]; - remainingLength--; - } - } - } - - return result; -} - -- (NSString *)stringBySha256HashingString:(NSString *)input { - const char *string = [input UTF8String]; - unsigned char result[CC_SHA256_DIGEST_LENGTH]; - CC_SHA256(string, (CC_LONG)strlen(string), result); - - NSMutableString *hashed = [NSMutableString stringWithCapacity:CC_SHA256_DIGEST_LENGTH * 2]; - for (NSInteger i = 0; i < CC_SHA256_DIGEST_LENGTH; i++) { - [hashed appendFormat:@"%02x", result[i]]; - } - return hashed; -} - -- (void)signInWithApple { - if (@available(iOS 13, *)) { - ASAuthorizationAppleIDRequest* request = [self appleIDRequestWithState:@"signIn"]; - - ASAuthorizationController* controller = [[ASAuthorizationController alloc] initWithAuthorizationRequests:@[request]]; - controller.delegate = self; - controller.presentationContextProvider = self; - [controller performRequests]; - } -} - -- (void)linkWithApple { - if (@available(iOS 13, *)) { - ASAuthorizationAppleIDRequest* request = [self appleIDRequestWithState:@"link"]; - - ASAuthorizationController* controller = [[ASAuthorizationController alloc] initWithAuthorizationRequests:@[request]]; - controller.delegate = self; - controller.presentationContextProvider = self; - [controller performRequests]; - } -} - -- (void)reauthenticateWithApple { - if (@available(iOS 13, *)) { - ASAuthorizationAppleIDRequest* request = [self appleIDRequestWithState:@"reauth"]; - - ASAuthorizationController* controller = [[ASAuthorizationController alloc] initWithAuthorizationRequests:@[request]]; - controller.delegate = self; - controller.presentationContextProvider = self; - [controller performRequests]; - } -} - -- (void)revokeAppleTokenAndDeleteUser { - FIRUser *user = [FIRAuth auth].currentUser; - - // Optionally revoke Apple token before account deletion - BOOL isAppleProviderLinked = false; - for (id provider in user.providerData) { - if ([[provider providerID] isEqual: @"apple.com"]) { - isAppleProviderLinked = true; - } - } - if (isAppleProviderLinked) { - if (@available(iOS 13, *)) { - ASAuthorizationAppleIDRequest* request = [self appleIDRequestWithState:@"revokeAppleTokenAndDeleteUser"]; - ASAuthorizationController* controller = [[ASAuthorizationController alloc] initWithAuthorizationRequests:@[request]]; - controller.delegate = self; - controller.presentationContextProvider = self; - [controller performRequests]; - - } else { - // Usual user deletion - } - } -} - -- (void)authorizationController:(ASAuthorizationController *)controller didCompleteWithAuthorization:(ASAuthorization *)authorization API_AVAILABLE(ios(13.0)) { - ASAuthorizationAppleIDCredential* appleIDCredential = authorization.credential; - NSString *IDToken = [NSString stringWithUTF8String:[appleIDCredential.identityToken bytes]]; - FIROAuthCredential *credential = - [FIROAuthProvider appleCredentialWithIDToken:IDToken - rawNonce:self.appleRawNonce - fullName:appleIDCredential.fullName]; - - if ([appleIDCredential.state isEqualToString:@"signIn"]) { - [FIRAuth.auth signInWithCredential:credential completion:^(FIRAuthDataResult * _Nullable authResult, NSError * _Nullable error) { - if (!error) { - NSLog(@"%@", authResult.description); - } else { - NSLog(@"%@", error.description); - } - }]; - } else if ([appleIDCredential.state isEqualToString:@"link"]) { - [FIRAuth.auth.currentUser linkWithCredential:credential completion:^(FIRAuthDataResult * _Nullable authResult, NSError * _Nullable error) { - if (!error) { - NSLog(@"%@", authResult.description); - } else { - NSLog(@"%@", error.description); - } - }]; - } else if ([appleIDCredential.state isEqualToString:@"reauth"]) { - [FIRAuth.auth.currentUser reauthenticateWithCredential:credential completion:^(FIRAuthDataResult * _Nullable authResult, NSError * _Nullable error) { - if (!error) { - NSLog(@"%@", authResult.description); - } else { - NSLog(@"%@", error.description); - } - }]; - } else if ([appleIDCredential.state isEqualToString:@"revokeAppleTokenAndDeleteUser"]) { - NSString *code = [[NSString alloc] initWithData:appleIDCredential.authorizationCode encoding:NSUTF8StringEncoding]; - FIRUser *user = FIRAuth.auth.currentUser; - [FIRAuth.auth revokeTokenWithAuthorizationCode:code completion:^(NSError * _Nullable error) { - if (!error) { - // Token revocation succeeded then delete user again. - [user deleteWithCompletion:^(NSError *_Nullable error) { - if (error) { - [self logFailure:@"delete account failed" error:error]; - } - [self showTypicalUIForUserUpdateResultsWithTitle:@"Delete User" error:error]; - }]; - } else { - NSLog(@"%@", error.description); - } - }]; - } -} - -- (void)authorizationController:(ASAuthorizationController *)controller didCompleteWithError:(NSError *)error API_AVAILABLE(ios(13.0)) { - NSLog(@"%@", error.description); -} - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+OOB.h b/FirebaseAuth/Tests/Sample/Sample/MainViewController+OOB.h deleted file mode 100644 index 2c16d87dc3c..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+OOB.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#import "MainViewController.h" - -#import -#import "StaticContentTableViewManager.h" - -NS_ASSUME_NONNULL_BEGIN - -static NSString *const kPasswordResetAction = @"resetPassword"; - -static NSString *const kVerifyEmailAction = @"verifyEmail"; - -@interface MainViewController (OOB) - -- (StaticContentTableViewSection *)oobSection; - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+OOB.m b/FirebaseAuth/Tests/Sample/Sample/MainViewController+OOB.m deleted file mode 100644 index bb021c021c0..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+OOB.m +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "MainViewController+OOB.h" - -#import "AppManager.h" -#import "MainViewController+Internal.h" - -NS_ASSUME_NONNULL_BEGIN - -@implementation MainViewController (OOB) - -- (StaticContentTableViewSection *)oobSection { - __weak typeof(self) weakSelf = self; - return [StaticContentTableViewSection sectionWithTitle:@"OOB" cells:@[ - [StaticContentTableViewCell cellWithTitle:@"Action Type" - value:[self actionCodeRequestTypeString] - action:^{ [weakSelf toggleActionCodeRequestType]; }], - [StaticContentTableViewCell cellWithTitle:@"Continue URL" - value:self.actionCodeContinueURL.absoluteString ?: @"(nil)" - action:^{ [weakSelf changeActionCodeContinueURL]; }], - [StaticContentTableViewCell cellWithTitle:@"Request Verify Email" - action:^{ [weakSelf requestVerifyEmail]; }], - [StaticContentTableViewCell cellWithTitle:@"Request Password Reset" - action:^{ [weakSelf requestPasswordReset]; }], - [StaticContentTableViewCell cellWithTitle:@"Reset Password" - action:^{ [weakSelf resetPassword]; }], - [StaticContentTableViewCell cellWithTitle:@"Check Action Code" - action:^{ [weakSelf checkActionCode]; }], - [StaticContentTableViewCell cellWithTitle:@"Apply Action Code" - action:^{ [weakSelf applyActionCode]; }], - [StaticContentTableViewCell cellWithTitle:@"Verify Password Reset Code" - action:^{ [weakSelf verifyPasswordResetCode]; }], - ]]; -} - -- (void)toggleActionCodeRequestType { - switch (self.actionCodeRequestType) { - case ActionCodeRequestTypeInApp: - self.actionCodeRequestType = ActionCodeRequestTypeContinue; - break; - case ActionCodeRequestTypeContinue: - self.actionCodeRequestType = ActionCodeRequestTypeEmail; - break; - case ActionCodeRequestTypeEmail: - self.actionCodeRequestType = ActionCodeRequestTypeInApp; - break; - } - [self updateTable]; -} - -- (NSString *)nameForActionCodeOperation:(FIRActionCodeOperation)operation { - switch (operation) { - case FIRActionCodeOperationVerifyEmail: - return @"Verify Email"; - case FIRActionCodeOperationRecoverEmail: - return @"Recover Email"; - case FIRActionCodeOperationPasswordReset: - return @"Password Reset"; - case FIRActionCodeOperationEmailLink: - return @"Email Sign-In Link"; - case FIRActionCodeOperationVerifyAndChangeEmail: - return @"Verify Before Change Email"; - case FIRActionCodeOperationRevertSecondFactorAddition: - return @"Revert Second Factor Addition"; - case FIRActionCodeOperationUnknown: - return @"Unknown action"; - } -} - -- (NSString *)actionCodeRequestTypeString { - switch (self.actionCodeRequestType) { - case ActionCodeRequestTypeInApp: - return @"In-App + Continue URL"; - case ActionCodeRequestTypeContinue: - return @"Continue URL"; - case ActionCodeRequestTypeEmail: - return @"Email Only"; - } -} - -- (void)changeActionCodeContinueURL { - [self showTextInputPromptWithMessage:@"Continue URL" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable userInput) { - if (userPressedOK) { - self.actionCodeContinueURL = userInput.length ? [NSURL URLWithString:userInput] : nil; - [self updateTable]; - } - }]; -} - -- (void)requestVerifyEmail { - [self showSpinner:^{ - void (^sendEmailVerification)(void (^)(NSError *)) = ^(void (^completion)(NSError *)) { - if (self.actionCodeRequestType == ActionCodeRequestTypeEmail) { - [[self user] sendEmailVerificationWithCompletion:completion]; - } else { - [[self user] sendEmailVerificationWithActionCodeSettings:[self actionCodeSettings] - completion:completion]; - } - }; - sendEmailVerification(^(NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"request verify email failed" error:error]; - [self showMessagePrompt:error.localizedDescription]; - return; - } - [self logSuccess:@"request verify email succeeded."]; - [self showMessagePrompt:@"Sent"]; - }]; - }); - }]; -} - -- (void)requestPasswordReset { - [self showTextInputPromptWithMessage:@"Email:" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable userInput) { - if (!userPressedOK || !userInput.length) { - return; - } - [self showSpinner:^{ - void (^requestPasswordReset)(void (^)(NSError *)) = ^(void (^completion)(NSError *)) { - if (self.actionCodeRequestType == ActionCodeRequestTypeEmail) { - [[AppManager auth] sendPasswordResetWithEmail:userInput completion:completion]; - } else { - [[AppManager auth] sendPasswordResetWithEmail:userInput - actionCodeSettings:[self actionCodeSettings] - completion:completion]; - } - }; - requestPasswordReset(^(NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"request password reset failed" error:error]; - [self showMessagePrompt:error.localizedDescription]; - return; - } - [self logSuccess:@"request password reset succeeded."]; - [self showMessagePrompt:@"Sent"]; - }]; - }); - }]; - }]; -} - -- (void)resetPassword { - [self showTextInputPromptWithMessage:@"OOB Code:" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable userInput) { - if (!userPressedOK || !userInput.length) { - return; - } - NSString *code = userInput; - [self showTextInputPromptWithMessage:@"New Password:" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable userInput) { - if (!userPressedOK || !userInput.length) { - return; - } - - [self showSpinner:^{ - [[AppManager auth] confirmPasswordResetWithCode:code - newPassword:userInput - completion:^(NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"Password reset failed" error:error]; - [self showMessagePrompt:error.localizedDescription]; - return; - } - [self logSuccess:@"Password reset succeeded."]; - [self showMessagePrompt:@"Password reset succeeded."]; - }]; - }]; - }]; - }]; - }]; -} - -- (void)checkActionCode { - [self showTextInputPromptWithMessage:@"OOB Code:" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable userInput) { - if (!userPressedOK || !userInput.length) { - return; - } - [self showSpinner:^{ - [[AppManager auth] checkActionCode:userInput completion:^(FIRActionCodeInfo *_Nullable info, - NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"Check action code failed" error:error]; - [self showMessagePrompt:error.localizedDescription]; - return; - } - [self logSuccess:@"Check action code succeeded."]; - NSString *email = info.email; - NSString *previousEmail = info.previousEmail; - NSString *message = - previousEmail ? [NSString stringWithFormat:@"%@ -> %@", previousEmail, email] : email; - NSString *operation = [self nameForActionCodeOperation:info.operation]; - [self showMessagePromptWithTitle:operation - message:message - showCancelButton:NO - completion:nil]; - }]; - }]; - }]; - }]; -} - -- (void)applyActionCode { - [self showTextInputPromptWithMessage:@"OOB Code:" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable userInput) { - if (!userPressedOK || !userInput.length) { - return; - } - [self showSpinner:^{ - - [[AppManager auth] applyActionCode:userInput completion:^(NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"Apply action code failed" error:error]; - [self showMessagePrompt:error.localizedDescription]; - return; - } - [self logSuccess:@"Apply action code succeeded."]; - [self showMessagePrompt:@"Action code was properly applied."]; - }]; - }]; - }]; - }]; -} - -- (void)verifyPasswordResetCode { - [self showTextInputPromptWithMessage:@"OOB Code:" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable userInput) { - if (!userPressedOK || !userInput.length) { - return; - } - [self showSpinner:^{ - [[AppManager auth] verifyPasswordResetCode:userInput completion:^(NSString *_Nullable email, - NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"Verify password reset code failed" error:error]; - [self showMessagePrompt:error.localizedDescription]; - return; - } - [self logSuccess:@"Verify password resest code succeeded."]; - NSString *alertMessage = - [[NSString alloc] initWithFormat:@"Code verified for email: %@", email]; - [self showMessagePrompt:alertMessage]; - }]; - }]; - }]; - }]; -} - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Phone.h b/FirebaseAuth/Tests/Sample/Sample/MainViewController+Phone.h deleted file mode 100644 index 744759b9d55..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Phone.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#import "MainViewController.h" - -#import "MainViewController+Internal.h" -#import "StaticContentTableViewManager.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface MainViewController (Phone) - -- (StaticContentTableViewSection *)phoneAuthSection; - -- (void)commonPhoneNumberInputWithTitle:(NSString *)title - completion:(TextInputCompletionBlock)completion; - -- (void)signInWithPhoneNumber:(NSString *_Nullable)phoneNumber - completion:(nullable TestAutomationCallback)completion; - -- (void)linkPhoneNumber:(NSString *_Nullable)phoneNumber - completion:(nullable TestAutomationCallback)completion; - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Phone.m b/FirebaseAuth/Tests/Sample/Sample/MainViewController+Phone.m deleted file mode 100644 index bcc971ffb39..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+Phone.m +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "MainViewController+Phone.h" - -#import "AppManager.h" - -NS_ASSUME_NONNULL_BEGIN - -@implementation MainViewController (Phone) - -- (StaticContentTableViewSection *)phoneAuthSection { - __weak typeof(self) weakSelf = self; - return [StaticContentTableViewSection sectionWithTitle:@"Phone Auth" cells:@[ - [StaticContentTableViewCell cellWithTitle:@"Sign in With Phone Number" - action:^{ [weakSelf signInWithPhoneNumberWithPrompt]; }], - [StaticContentTableViewCell cellWithTitle:@"Link Phone Number" - action:^{ [weakSelf linkPhoneNumberWithPrompt]; }], - [StaticContentTableViewCell cellWithTitle:@"Unlink Phone Number" - action:^{ [weakSelf unlinkFromProvider:FIRPhoneAuthProvider.id completion:nil]; }], - ]]; -} - -- (void)signInWithPhoneNumber:(NSString *_Nullable)phoneNumber - completion:(nullable TestAutomationCallback)completion { - [self showSpinner:^{ - [[AppManager phoneAuthProvider] verifyPhoneNumber:phoneNumber - UIDelegate:nil - completion:^(NSString *_Nullable verificationID, - NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"failed to send verification code" error:error]; - [self showMessagePrompt:error.localizedDescription]; - if (completion) { - completion(error); - } - return; - } - [self logSuccess:@"Code sent"]; - [self commonPhoneNumberInputWithTitle:@"Code" - completion:^(NSString *_Nullable verificationCode) { - [self commontPhoneVerificationWithVerificationID:verificationID - verificationCode:verificationCode]; - if (completion) { - completion(nil); - } - }]; - }]; - }]; - }]; -} - -- (void)signInWithPhoneNumberWithPrompt { - [self commonPhoneNumberInputWithTitle:@"Phone #" - completion:^(NSString *_Nullable phone) { - [self signInWithPhoneNumber:phone completion:nil]; - }]; -} - -- (void)commonPhoneNumberInputWithTitle:(NSString *)title - completion:(TextInputCompletionBlock)completion { - [self showTextInputPromptWithMessage:title - keyboardType:UIKeyboardTypePhonePad - completionBlock:^(BOOL userPressedOK, NSString *_Nullable phoneNumber) { - if (!userPressedOK) { - return; - } - completion(phoneNumber); - }]; -} - -- (void)commontPhoneVerificationWithVerificationID:(NSString *)verificationID - verificationCode:(NSString *)verificationCode { - [self showSpinner:^{ - FIRAuthCredential *credential = - [[AppManager phoneAuthProvider] credentialWithVerificationID:verificationID - verificationCode:verificationCode]; - [[AppManager auth] signInWithCredential:credential - completion:^(FIRAuthDataResult *_Nullable result, - NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"failed to verify phone number" error:error]; - [self showMessagePrompt:error.localizedDescription]; - return; - } - if (self.isNewUserToggleOn) { - NSString *newUserString = result.additionalUserInfo.isNewUser ? - @"New user" : @"Existing user"; - [self showMessagePromptWithTitle:@"New or Existing" - message:newUserString - showCancelButton:NO - completion:nil]; - } - }]; - }]; - }]; -} - -- (void)linkPhoneNumber:(NSString *_Nullable)phoneNumber - completion:(nullable TestAutomationCallback)completion { - [self showSpinner:^{ - [[AppManager phoneAuthProvider] verifyPhoneNumber:phoneNumber - UIDelegate:nil - completion:^(NSString *_Nullable verificationID, - NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"failed to send verification code" error:error]; - [self showMessagePrompt:error.localizedDescription]; - if (completion) { - completion(error); - } - return; - } - [self logSuccess:@"Code sent"]; - - [self showTextInputPromptWithMessage:@"Verification code:" - keyboardType:UIKeyboardTypeNumberPad - completionBlock:^(BOOL userPressedOK, - NSString *_Nullable verificationCode) { - if (!userPressedOK || !verificationCode.length) { - return; - } - [self showSpinner:^{ - FIRPhoneAuthCredential *credential = - [[AppManager phoneAuthProvider] credentialWithVerificationID:verificationID - verificationCode:verificationCode]; - [[self user] linkWithCredential:credential - completion:^(FIRAuthDataResult *_Nullable result, - NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - if (error.code == FIRAuthErrorCodeCredentialAlreadyInUse) { - [self showMessagePromptWithTitle:@"Phone number is already linked to " - @"another user" - message:@"Tap Ok to sign in with that user now." - showCancelButton:YES - completion:^(BOOL userPressedOK, - NSString *_Nullable userInput) { - if (userPressedOK) { - // If FIRAuthErrorCodeCredentialAlreadyInUse error, sign in with the - // provided credential. - [self showSpinner:^{ - FIRPhoneAuthCredential *credential = - error.userInfo[FIRAuthErrors.userInfoUpdatedCredentialKey]; - [[AppManager auth] signInWithCredential:credential - completion:^(FIRAuthDataResult *_Nullable result, - NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"failed to verify phone number" error:error]; - [self showMessagePrompt:error.localizedDescription]; - if (completion) { - completion(error); - } - return; - } - }]; - }]; - }]; - } - }]; - } else { - [self logFailure:@"link phone number failed" error:error]; - [self showMessagePrompt:error.localizedDescription]; - } - return; - } - [self logSuccess:@"link phone number succeeded."]; - if (completion) { - completion(nil); - } - }]; - }]; - }]; - }]; - }]; - }]; - }]; -} - -- (void)linkPhoneNumberWithPrompt { - [self showTextInputPromptWithMessage:@"Phone #:" - keyboardType:UIKeyboardTypePhonePad - completionBlock:^(BOOL userPressedOK, NSString *_Nullable phoneNumber) { - if (!userPressedOK || !phoneNumber.length) { - return; - } - [self linkPhoneNumber:phoneNumber completion:nil]; - }]; -} - - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+User.h b/FirebaseAuth/Tests/Sample/Sample/MainViewController+User.h deleted file mode 100644 index 5734917b705..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+User.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#import "MainViewController.h" - -#import "MainViewController+Internal.h" -#import "StaticContentTableViewManager.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface MainViewController (User) - -- (StaticContentTableViewSection *)userSection; - -- (void)reloadUser; - -- (void)updatePhoneNumber:(NSString *_Nullable)phoneNumber - completion:(nullable TestAutomationCallback)completion; - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController+User.m b/FirebaseAuth/Tests/Sample/Sample/MainViewController+User.m deleted file mode 100644 index 7d6362a54fa..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController+User.m +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "MainViewController+User.h" - -#import "AppManager.h" - -NS_ASSUME_NONNULL_BEGIN - -@implementation MainViewController (User) - -- (StaticContentTableViewSection *)userSection { - __weak typeof(self) weakSelf = self; - return [StaticContentTableViewSection sectionWithTitle:@"User" cells:@[ - [StaticContentTableViewCell cellWithTitle:@"Set Display Name" - action:^{ [weakSelf setDisplayName]; }], - [StaticContentTableViewCell cellWithTitle:@"Set Photo URL" - action:^{ [weakSelf setPhotoURL]; }], - [StaticContentTableViewCell cellWithTitle:@"Update Email" - action:^{ [weakSelf updateEmail]; }], - [StaticContentTableViewCell cellWithTitle:@"Update Password" - action:^{ [weakSelf updatePassword]; }], - [StaticContentTableViewCell cellWithTitle:@"Update Phone Number" - action:^{ [weakSelf updatePhoneNumber]; }], - [StaticContentTableViewCell cellWithTitle:@"Get Sign-in methods for Email" - action:^{ [weakSelf getAllSignInMethodsForEmail]; }], - [StaticContentTableViewCell cellWithTitle:@"Reload User" - action:^{ [weakSelf reloadUser]; }], - [StaticContentTableViewCell cellWithTitle:@"Delete User" - action:^{ [weakSelf deleteAccount]; }], - [StaticContentTableViewCell cellWithTitle:@"Verify before update email" - action:^{ [weakSelf verifyBeforeUpdateEmail]; }], - ]]; -} - -- (void)setDisplayName { - [self showTextInputPromptWithMessage:@"Display Name:" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable userInput) { - if (!userPressedOK || !userInput.length) { - return; - } - [self showSpinner:^{ - FIRUserProfileChangeRequest *changeRequest = [[self user] profileChangeRequest]; - changeRequest.displayName = userInput; - [changeRequest commitChangesWithCompletion:^(NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"set display name failed" error:error]; - } else { - [FIRAuth.auth.currentUser getIDTokenResultWithCompletion:^(FIRAuthTokenResult *_Nullable tokenResult, - NSError *_Nullable error) { - [self logSuccess:@"set display name succeeded."]; - }]; - } - [self showTypicalUIForUserUpdateResultsWithTitle:@"Set Display Name" error:error]; - }]; - }]; - }]; - }]; -} - -- (void)setPhotoURL { - [self showTextInputPromptWithMessage:@"Photo URL:" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable userInput) { - if (!userPressedOK || !userInput.length) { - return; - } - [self showSpinner:^{ - FIRUserProfileChangeRequest *changeRequest = [[self user] profileChangeRequest]; - changeRequest.photoURL = [NSURL URLWithString:userInput]; - [changeRequest commitChangesWithCompletion:^(NSError *_Nullable error) { - if (error) { - [self logFailure:@"set photo URL failed" error:error]; - } else { - [self logSuccess:@"set Photo URL succeeded."]; - } - [self hideSpinner:^{ - [self showTypicalUIForUserUpdateResultsWithTitle:@"Set Photo URL" error:error]; - }]; - }]; - }]; - }]; -} - -- (void)reloadUser { - [self showSpinner:^() { - [[self user] reloadWithCompletion:^(NSError *_Nullable error) { - if (error) { - [self logFailure:@"reload user failed" error:error]; - } else { - [self logSuccess:@"reload user succeeded."]; - } - [self hideSpinner:^() { - [self showTypicalUIForUserUpdateResultsWithTitle:@"Reload User" error:error]; - }]; - }]; - }]; -} - -- (void)getAllSignInMethodsForEmail { - [self showTextInputPromptWithMessage:@"Email:" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable userInput) { - if (!userPressedOK || !userInput.length) { - return; - } - [self showSpinner:^{ - [[AppManager auth] fetchSignInMethodsForEmail:userInput - completion:^(NSArray *_Nullable signInMethods, - NSError *_Nullable error) { - if (error) { - [self logFailure:@"get sign-in methods for email failed" error:error]; - } else { - [self logSuccess:@"get sign-in methods for email succeeded."]; - } - [self hideSpinner:^{ - if (error) { - [self showMessagePrompt:error.localizedDescription]; - return; - } - [self showMessagePrompt:[signInMethods componentsJoinedByString:@", "]]; - }]; - }]; - }]; - }]; -} -- (void)updateEmail { - [self showTextInputPromptWithMessage:@"Email Address:" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable userInput) { - if (!userPressedOK || !userInput.length) { - return; - } - [self showSpinner:^{ - [[self user] updateEmail:userInput completion:^(NSError *_Nullable error) { - if (error) { - [self logFailure:@"update email failed" error:error]; - } else { - [self logSuccess:@"update email succeeded."]; - } - [self hideSpinner:^{ - [self showTypicalUIForUserUpdateResultsWithTitle:@"Update Email" error:error]; - }]; - }]; - }]; - }]; -} - -- (void)verifyBeforeUpdateEmail { - [self showTextInputPromptWithMessage:@"Email Address:" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable userInput) { - if (!userPressedOK || !userInput.length) { - return; - } - [self showSpinner:^{ - [[self user] sendEmailVerificationBeforeUpdatingEmail:userInput - actionCodeSettings:[self actionCodeSettings] - completion:^(NSError *_Nullable error) { - if (error) { - [self logFailure:@"verify before update email failed." error:error]; - } else { - [self logSuccess:@"verify before update email succeeded."]; - } - [self hideSpinner:^{ - [self showTypicalUIForUserUpdateResultsWithTitle:@"Update Email" error:error]; - }]; - }]; - }]; - }]; -} - -- (void)updatePassword { - [self showTextInputPromptWithMessage:@"New Password:" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable userInput) { - if (!userPressedOK) { - return; - } - [self showSpinner:^{ - [[self user] updatePassword:userInput completion:^(NSError *_Nullable error) { - if (error) { - [self logFailure:@"update password failed" error:error]; - } else { - [self logSuccess:@"update password succeeded."]; - } - [self hideSpinner:^{ - [self showTypicalUIForUserUpdateResultsWithTitle:@"Update Password" error:error]; - }]; - }]; - }]; - }]; -} - -- (void)deleteAccount { - FIRUser *user = [self user]; - [user deleteWithCompletion:^(NSError *_Nullable error) { - if (error) { - [self logFailure:@"delete account failed" error:error]; - } - [self showTypicalUIForUserUpdateResultsWithTitle:@"Delete User" error:error]; - }]; -} - -- (void)updatePhoneNumber:(NSString *_Nullable)phoneNumber - completion:(nullable TestAutomationCallback)completion { - [self showSpinner:^{ - [[AppManager phoneAuthProvider] verifyPhoneNumber:phoneNumber - UIDelegate:nil - completion:^(NSString *_Nullable verificationID, - NSError *_Nullable error) { - if (error) { - [self logFailure:@"failed to send verification code" error:error]; - [self showMessagePrompt:error.localizedDescription]; - if (completion) { - completion(error); - } - return; - } - [self logSuccess:@"Code sent"]; - - [self showTextInputPromptWithMessage:@"Verification code:" - keyboardType:UIKeyboardTypeNumberPad - completionBlock:^(BOOL userPressedOK, - NSString *_Nullable verificationCode) { - if (!userPressedOK || !verificationCode.length) { - return; - } - [self showSpinner:^{ - FIRPhoneAuthCredential *credential = - [[AppManager phoneAuthProvider] credentialWithVerificationID:verificationID - verificationCode:verificationCode]; - [[self user] updatePhoneNumberCredential:credential - completion:^(NSError *_Nullable error) { - if (error) { - [self logFailure:@"update phone number failed" error:error]; - [self showMessagePrompt:error.localizedDescription]; - if (completion) { - completion(error); - } - } else { - [self logSuccess:@"update phone number succeeded."]; - if (completion) { - completion(nil); - } - } - }]; - }]; - }]; - }]; - }]; -} - -- (void)updatePhoneNumber { - [self showTextInputPromptWithMessage:@"Update Phone #:" - keyboardType:UIKeyboardTypePhonePad - completionBlock:^(BOOL userPressedOK, NSString *_Nullable phoneNumber) { - if (!userPressedOK || !phoneNumber.length) { - return; - } - [self updatePhoneNumber:phoneNumber completion:nil]; - }]; -} - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController.h b/FirebaseAuth/Tests/Sample/Sample/MainViewController.h deleted file mode 100644 index 68205415411..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -NS_ASSUME_NONNULL_BEGIN - -@class StaticContentTableViewManager; -@class UserTableViewCell; - -/** @class MainViewController - @brief The first view controller presented when the application is started. - */ -@interface MainViewController : UIViewController - -/** @property tableViewManager - @brief A @c StaticContentTableViewManager which is used to manage the contents of the table - view. - */ -@property(nonatomic, strong) IBOutlet StaticContentTableViewManager *tableViewManager; - -/** @property tableView - @brief A UITableView which is used to display user info and a list of actions. - */ -@property(nonatomic, weak) IBOutlet UITableView *tableView; - -/** @property userInfoTableViewCell - @brief A custom UITableViewCell for displaying the user info. - */ -@property(nonatomic, strong) IBOutlet UserTableViewCell *userInfoTableViewCell; - -/** @property userInMemoryInfoTableViewCell - @brief A custom UITableViewCell for displaying the user info. - */ -@property(nonatomic, strong) IBOutlet UserTableViewCell *userInMemoryInfoTableViewCell; - -/** @property userToUseCell - @brief A custom UITableViewCell for choosing which user to use for user operations (either the - currently signed-in user, or the user in "memory". - */ -@property(nonatomic, strong) IBOutlet UITableViewCell *userToUseCell; - -/** @property consoleTextView - @brief A UITextView with a log of the actions performed in the sample app. - */ -@property(nonatomic, weak) IBOutlet UITextView *consoleTextView; - -/** @fn handleIncomingLinkWithURL: - @brief Handles an incoming link to trigger the appropriate OOBCode if possible. - @param URL The webURL of the incoming universal link. - @return Boolean value indicating whether the incoming link could be handled or not. - */ -- (BOOL)handleIncomingLinkWithURL:(NSURL *)URL; - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController.m b/FirebaseAuth/Tests/Sample/Sample/MainViewController.m deleted file mode 100644 index 4d9e1329f36..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController.m +++ /dev/null @@ -1,721 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#import "AppManager.h" -#import "AuthCredentials.h" -#import "FacebookAuthProvider.h" -#import -#import "GoogleAuthProvider.h" -#import "MainViewController+App.h" -#import "MainViewController+Auth.h" -#import "MainViewController+AutoTests.h" -#import "MainViewController+Custom.h" -#import "MainViewController+Email.h" -#import "MainViewController+Facebook.h" -#import "MainViewController+GameCenter.h" -#import "MainViewController+Google.h" -#import "MainViewController+Internal.h" -#import "MainViewController+MultiFactor.h" -#import "MainViewController+OAuth.h" -#import "MainViewController+OOB.h" -#import "MainViewController+Phone.h" -#import "MainViewController+User.h" -#import "SettingsViewController.h" -#import "StaticContentTableViewManager.h" -#import "UIViewController+Alerts.h" -#import "UserInfoViewController.h" -#import "UserTableViewCell.h" -@import FirebaseAuth;;; - -NS_ASSUME_NONNULL_BEGIN - -static NSString *const kSectionTitleSettings = @"Settings"; - -static NSString *const kSectionTitleUserDetails = @"User Defaults"; - -static NSString *const kSwitchToInMemoryUserTitle = @"Switch to in memory user"; - -static NSString *const kNewOrExistingUserToggleTitle = @"New or Existing User Toggle"; - -typedef void (^FIRTokenCallback)(NSString *_Nullable token, NSError *_Nullable error); - -@implementation MainViewController { - NSMutableString *_consoleString; - - /** @var _userInMemory - @brief Acts like the "memory" function of a calculator. An operation allows sample app users - to assign this value based on @c FIRAuth.currentUser or clear this value. - */ - FIRUser *_userInMemory; - - /** @var _useUserInMemory - @brief Instructs the application to use _userInMemory instead of @c FIRAuth.currentUser for - testing operations. This allows us to test if things still work with a user who is not - the @c FIRAuth.currentUser, and also allows us to test those things while - @c FIRAuth.currentUser remains nil (after a sign-out) and also when @c FIRAuth.currentUser - is non-nil (do to a subsequent sign-in.) - */ - BOOL _useUserInMemory; -} - -// TODO: restore this -const NSNotificationName FIRAuthStateDidChangeNotification = @"FIRAuthStateDidChangeNotification"; - -- (id)initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil { - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) { - _actionCodeRequestType = ActionCodeRequestTypeInApp; - _actionCodeContinueURL = [NSURL URLWithString:KCONTINUE_URL]; - _authStateDidChangeListeners = [NSMutableArray array]; - _IDTokenDidChangeListeners = [NSMutableArray array]; - _googleOAuthProvider = [FIROAuthProvider providerWithProviderID:FIRGoogleAuthProvider.id]; - _microsoftOAuthProvider = [FIROAuthProvider providerWithProviderID:@"microsoft.com"]; - _twitterOAuthProvider = [FIROAuthProvider providerWithProviderID:@"twitter.com"]; - _linkedinOAuthProvider = [FIROAuthProvider providerWithProviderID:@"linkedin.com"]; - _yahooOAuthProvider = [FIROAuthProvider providerWithProviderID:@"yahoo.com"]; - _gitHubOAuthProvider = [FIROAuthProvider providerWithProviderID:@"github.com"]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(authStateChangedForAuth:) - name:FIRAuthStateDidChangeNotification - object:nil]; - self.useStatusBarSpinner = YES; - } - return self; -} - -- (void)viewDidLoad { - [super viewDidLoad]; - - // Give us a circle for the image view: - _userInfoTableViewCell.userInfoProfileURLImageView.layer.cornerRadius = - _userInfoTableViewCell.userInfoProfileURLImageView.frame.size.width / 2.0f; - _userInfoTableViewCell.userInfoProfileURLImageView.layer.masksToBounds = YES; - _userInMemoryInfoTableViewCell.userInfoProfileURLImageView.layer.cornerRadius = - _userInMemoryInfoTableViewCell.userInfoProfileURLImageView.frame.size.width / 2.0f; - _userInMemoryInfoTableViewCell.userInfoProfileURLImageView.layer.masksToBounds = YES; -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - [self updateTable]; - [self updateUserInfo]; -} - -#pragma mark - Public - -- (BOOL)handleIncomingLinkWithURL:(NSURL *)URL { - // Parse the query portion of the incoming URL. - NSDictionary *queryItems = - parseURL([NSURLComponents componentsWithString:URL.absoluteString].query); - - // Check that all necessary query items are available. - NSString *actionCode = queryItems[@"oobCode"]; - NSString *mode = queryItems[@"mode"]; - if (!actionCode || !mode) { - return NO; - } - // Handle Password Reset action. - if ([mode isEqualToString:kPasswordResetAction]) { - [self showTextInputPromptWithMessage:@"New Password:" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable newPassword) { - if (!userPressedOK || !newPassword.length) { - [UIPasteboard generalPasteboard].string = actionCode; - return; - } - [self showSpinner:^() { - [[AppManager auth] confirmPasswordResetWithCode:actionCode - newPassword:newPassword - completion:^(NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"Password reset in app failed" error:error]; - [self showMessagePrompt:error.localizedDescription]; - return; - } - [self logSuccess:@"Password reset in app succeeded."]; - [self showMessagePrompt:@"Password reset in app succeeded."]; - }]; - }]; - }]; - }]; - return YES; - } - if ([mode isEqualToString:kVerifyEmailAction]) { - [self showMessagePromptWithTitle:@"Tap OK to verify email" - message:actionCode - showCancelButton:YES - completion:^(BOOL userPressedOK, NSString *_Nullable userInput) { - if (!userPressedOK) { - return; - } - [self showSpinner:^() { - [[AppManager auth] applyActionCode:actionCode completion:^(NSError *_Nullable error) { - [self hideSpinner:^{ - if (error) { - [self logFailure:@"Verify email in app failed" error:error]; - [self showMessagePrompt:error.localizedDescription]; - return; - } - [self logSuccess:@"Verify email in app succeeded."]; - [self showMessagePrompt:@"Verify email in app succeeded."]; - }]; - }]; - }]; - }]; - return YES; - } - return NO; -} - -static NSDictionary *parseURL(NSString *urlString) { - NSString *linkURL = [NSURLComponents componentsWithString:urlString].query; - NSArray *URLComponents = [linkURL componentsSeparatedByString:@"&"]; - NSMutableDictionary *queryItems = - [[NSMutableDictionary alloc] initWithCapacity:URLComponents.count]; - for (NSString *component in URLComponents) { - NSRange equalRange = [component rangeOfString:@"="]; - if (equalRange.location != NSNotFound) { - NSString *queryItemKey = - [[component substringToIndex:equalRange.location] stringByRemovingPercentEncoding]; - NSString *queryItemValue = - [[component substringFromIndex:equalRange.location + 1] stringByRemovingPercentEncoding]; - if (queryItemKey && queryItemValue) { - queryItems[queryItemKey] = queryItemValue; - } - } - } - return queryItems; -} - -- (void)updateTable { - __weak typeof(self) weakSelf = self; - _tableViewManager.contents = - [StaticContentTableViewContent contentWithSections:@[ - // User Defaults - [StaticContentTableViewSection sectionWithTitle:kSectionTitleUserDetails cells:@[ - [StaticContentTableViewCell cellWithCustomCell:_userInfoTableViewCell action:^{ - [weakSelf presentUserInfo]; - }], - [StaticContentTableViewCell cellWithCustomCell:_userToUseCell], - [StaticContentTableViewCell cellWithCustomCell:_userInMemoryInfoTableViewCell action:^{ - [weakSelf presentUserInMemoryInfo]; - }], - ]], - // Settings - [StaticContentTableViewSection sectionWithTitle:kSectionTitleSettings cells:@[ - [StaticContentTableViewCell cellWithTitle:kSectionTitleSettings - action:^{ [weakSelf presentSettings]; }], - [StaticContentTableViewCell cellWithTitle:kNewOrExistingUserToggleTitle - value:_isNewUserToggleOn ? @"Enabled" : @"Disabled" - action:^{ - self->_isNewUserToggleOn = !self->_isNewUserToggleOn; - [self updateTable]; }], - [StaticContentTableViewCell cellWithTitle:kSwitchToInMemoryUserTitle - action:^{ [weakSelf updateToSavedUser]; }], - ]], - // Auth - [weakSelf authSection], - // User - [weakSelf userSection], - // Multi Factor - [weakSelf multiFactorSection], - // Email Auth - [weakSelf emailAuthSection], - // Phone Auth - [weakSelf phoneAuthSection], - // Google Auth - [weakSelf googleAuthSection], - // Facebook Auth - [weakSelf facebookAuthSection], - // OAuth - [weakSelf oAuthSection], - // Custom Auth - [weakSelf customAuthSection], - // Game Center Auth - [weakSelf gameCenterAuthSection], - // App - [weakSelf appSection], - // OOB - [weakSelf oobSection], - // Auto Tests - [weakSelf autoTestsSection], - ]]; -} - -#pragma mark - Internal - -- (FIRUser *)user { - return _useUserInMemory ? _userInMemory : [AppManager auth].currentUser; -} - -- (void)signInWithProvider:(nonnull id)provider callback:(void(^)(void))callback { - if (!provider) { - [self logFailedTest:@"A valid auth provider was not provided to the signInWithProvider."]; - return; - } - [provider getAuthCredentialWithPresentingViewController:self - callback:^(FIRAuthCredential *credential, - NSError *error) { - if (!credential) { - [self logFailedTest:@"The test needs a valid credential to continue."]; - return; - } - [[AppManager auth] signInWithCredential:credential - completion:^(FIRAuthDataResult *_Nullable result, - NSError *_Nullable error) { - if (error) { - [self logFailure:@"sign-in with provider failed" error:error]; - [self logFailedTest:@"Sign-in should succeed"]; - return; - } else { - [self logSuccess:@"sign-in with provider succeeded."]; - callback(); - } - }]; - }]; -} - -- (FIRActionCodeSettings *)actionCodeSettings { - FIRActionCodeSettings *actionCodeSettings = [[FIRActionCodeSettings alloc] init]; - actionCodeSettings.URL = self.actionCodeContinueURL; - actionCodeSettings.handleCodeInApp = self.actionCodeRequestType == ActionCodeRequestTypeInApp; - return actionCodeSettings; -} - -- (void)reauthenticate:(id)authProvider retrieveData:(BOOL)retrieveData { - FIRUser *user = [self user]; - if (!user) { - NSString *provider = @"Firebase"; - if ([authProvider isKindOfClass:[GoogleAuthProvider class]]) { - provider = @"Google"; - } else if ([authProvider isKindOfClass:[FacebookAuthProvider class]]) { - provider = @"Facebook"; - } - NSString *title = @"Missing User"; - NSString *message = - [NSString stringWithFormat:@"There is no signed-in %@ user.", provider]; - [self showMessagePromptWithTitle:title message:message showCancelButton:NO completion:nil]; - return; - } - [authProvider getAuthCredentialWithPresentingViewController:self - callback:^(FIRAuthCredential *credential, - NSError *error) { - if (credential) { - FIRAuthDataResultCallback completion = ^(FIRAuthDataResult *_Nullable authResult, - NSError *_Nullable error) { - if (error) { - if (error.code == FIRAuthErrorCodeSecondFactorRequired) { - FIRMultiFactorResolver *resolver = error.userInfo[FIRAuthErrors.FIRAuthErrorUserInfoMultiFactorResolverKey]; - NSMutableString *displayNameString = [NSMutableString string]; - for (FIRMultiFactorInfo *tmpFactorInfo in resolver.hints) { - [displayNameString appendString:tmpFactorInfo.displayName]; - [displayNameString appendString:@" "]; - } - [self showTextInputPromptWithMessage:[NSString stringWithFormat:@"Select factor to reauthenticate\n%@", displayNameString] - completionBlock:^(BOOL userPressedOK, NSString *_Nullable displayName) { - FIRPhoneMultiFactorInfo* selectedHint; - for (FIRMultiFactorInfo *tmpFactorInfo in resolver.hints) { - if ([displayName isEqualToString:tmpFactorInfo.displayName]) { - selectedHint = (FIRPhoneMultiFactorInfo *)tmpFactorInfo; - } - } - [FIRPhoneAuthProvider.provider - verifyPhoneNumberWithMultiFactorInfo:selectedHint - UIDelegate:nil - multiFactorSession:resolver.session - completion:^(NSString * _Nullable verificationID, NSError * _Nullable error) { - if (error) { - [self logFailure:@"Multi factor start sign in failed." error:error]; - } else { - [self showTextInputPromptWithMessage:[NSString stringWithFormat:@"Verification code for %@", selectedHint.displayName] - completionBlock:^(BOOL userPressedOK, NSString *_Nullable verificationCode) { - FIRPhoneAuthCredential *credential = - [[FIRPhoneAuthProvider provider] credentialWithVerificationID:verificationID - verificationCode:verificationCode]; - FIRMultiFactorAssertion *assertion = [FIRPhoneMultiFactorGenerator assertionWithCredential:credential]; - [resolver resolveSignInWithAssertion:assertion completion:^(FIRAuthDataResult * _Nullable authResult, NSError * _Nullable error) { - if (error) { - [self logFailure:@"Multi factor finalize sign in failed." error:error]; - } else { - [self logSuccess:@"Multi factor finalize sign in succeeded."]; - } - }]; - }]; - } - }]; - }]; - } else { - [self logFailure:@"reauthenticate operation failed." error:error]; - } - } else { - [self logSuccess:@"reauthenticate operation succeeded."]; - } - if (authResult.additionalUserInfo) { - [self logSuccess:[self stringWithAdditionalUserInfo:authResult.additionalUserInfo]]; - } - }; - [user reauthenticateWithCredential:credential completion:completion]; - } - }]; -} - -- (void)signinWithProvider:(id)authProvider retrieveData:(BOOL)retrieveData { - FIRAuth *auth = [AppManager auth]; - if (!auth) { - return; - } - [authProvider getAuthCredentialWithPresentingViewController:self - callback:^(FIRAuthCredential *credential, - NSError *error) { - if (credential) { - FIRAuthDataResultCallback completion = ^(FIRAuthDataResult *_Nullable authResult, - NSError *_Nullable error) { - if (error) { - [self logFailure:@"sign-in with provider failed" error:error]; - } else { - [self logSuccess:@"sign-in with provider succeeded."]; - } - if (authResult.additionalUserInfo) { - [self logSuccess:[self stringWithAdditionalUserInfo:authResult.additionalUserInfo]]; - if (self->_isNewUserToggleOn) { - NSString *newUserString = authResult.additionalUserInfo.isNewUser ? - @"New user" : @"Existing user"; - [self showMessagePromptWithTitle:@"New or Existing" - message:newUserString - showCancelButton:NO - completion:nil]; - } - } - [self showTypicalUIForUserUpdateResultsWithTitle:@"Sign-In" error:error]; - }; - [auth signInWithCredential:credential completion:completion]; - } - }]; -} - -- (void)linkWithAuthProvider:(id)authProvider retrieveData:(BOOL)retrieveData { - FIRUser *user = [self user]; - if (!user) { - return; - } - [authProvider getAuthCredentialWithPresentingViewController:self - callback:^(FIRAuthCredential *credential, - NSError *error) { - if (credential) { - FIRAuthDataResultCallback completion = ^(FIRAuthDataResult *_Nullable authResult, - NSError *_Nullable error) { - if (error) { - if (error.code == FIRAuthErrorCodeSecondFactorRequired) { - FIRMultiFactorResolver *resolver = error.userInfo[FIRAuthErrors.FIRAuthErrorUserInfoMultiFactorResolverKey]; - NSMutableString *displayNameString = [NSMutableString string]; - for (FIRMultiFactorInfo *tmpFactorInfo in resolver.hints) { - [displayNameString appendString:tmpFactorInfo.displayName]; - [displayNameString appendString:@" "]; - } - [self showTextInputPromptWithMessage:[NSString stringWithFormat:@"Select factor to link\n%@", displayNameString] - completionBlock:^(BOOL userPressedOK, NSString *_Nullable displayName) { - FIRPhoneMultiFactorInfo* selectedHint; - for (FIRMultiFactorInfo *tmpFactorInfo in resolver.hints) { - if ([displayName isEqualToString:tmpFactorInfo.displayName]) { - selectedHint = (FIRPhoneMultiFactorInfo *)tmpFactorInfo; - } - } - [FIRPhoneAuthProvider.provider - verifyPhoneNumberWithMultiFactorInfo:selectedHint - UIDelegate:nil - multiFactorSession:resolver.session - completion:^(NSString * _Nullable verificationID, NSError * _Nullable error) { - if (error) { - [self logFailure:@"Multi factor start sign in failed." error:error]; - } else { - [self showTextInputPromptWithMessage:[NSString stringWithFormat:@"Verification code for %@", selectedHint.displayName] - completionBlock:^(BOOL userPressedOK, NSString *_Nullable verificationCode) { - FIRPhoneAuthCredential *credential = - [[FIRPhoneAuthProvider provider] credentialWithVerificationID:verificationID - verificationCode:verificationCode]; - FIRMultiFactorAssertion *assertion = [FIRPhoneMultiFactorGenerator assertionWithCredential:credential]; - [resolver resolveSignInWithAssertion:assertion completion:^(FIRAuthDataResult * _Nullable authResult, NSError * _Nullable error) { - if (error) { - [self logFailure:@"Multi factor finalize sign in failed." error:error]; - } else { - [self logSuccess:@"Multi factor finalize sign in succeeded."]; - } - }]; - }]; - } - }]; - }]; - } else { - [self logFailure:@"link auth provider failed" error:error]; - } - } else { - [self logSuccess:@"link auth provider succeeded."]; - } - if (authResult.additionalUserInfo) { - [self logSuccess:[self stringWithAdditionalUserInfo:authResult.additionalUserInfo]]; - } - }; - [user linkWithCredential:credential completion:completion]; - } - }]; -} - -- (void)unlinkFromProvider:(NSString *)provider - completion:(nullable TestAutomationCallback)completion { - [[self user] unlinkFromProvider:provider - completion:^(FIRUser *_Nullable user, - NSError *_Nullable error) { - if (error) { - [self logFailure:@"unlink auth provider failed" error:error]; - if (completion) { - completion(error); - } - return; - } - [self logSuccess:@"unlink auth provider succeeded."]; - if (completion) { - completion(nil); - } - [self showTypicalUIForUserUpdateResultsWithTitle:@"Unlink from Provider" error:error]; - }]; -} - -- (void)updateToSavedUser { - if(![AppManager auth].currentUser) { - NSLog(@"You must be signed in to perform this action"); - return; - } - - if (!_userInMemory) { - [self showMessagePrompt:[NSString stringWithFormat:@"You need an in-memory user to perform this" - "action, use the M+ button to save a user to memory.", nil]]; - return; - } - - [[AppManager auth] updateCurrentUser:_userInMemory completion:^(NSError *_Nullable error) { - if (error) { - [self showMessagePrompt: - [NSString stringWithFormat:@"An error Occurred: %@", error.localizedDescription]]; - return; - } - }]; -} - -#pragma mark - Private - -- (void)presentSettings { - SettingsViewController *settingsViewController = [[SettingsViewController alloc] - initWithNibName:NSStringFromClass([SettingsViewController class]) - bundle:nil]; - [self showViewController:settingsViewController sender:self]; -} - -- (void)presentUserInfo { - UserInfoViewController *userInfoViewController = - [[UserInfoViewController alloc] initWithUser:[AppManager auth].currentUser]; - [self showViewController:userInfoViewController sender:self]; -} - -- (void)presentUserInMemoryInfo { - UserInfoViewController *userInfoViewController = - [[UserInfoViewController alloc] initWithUser:_userInMemory]; - [self showViewController:userInfoViewController sender:self]; -} - -- (NSString *)stringWithAdditionalUserInfo:(nullable FIRAdditionalUserInfo *)additionalUserInfo { - if (!additionalUserInfo) { - return @"(no additional user info)"; - } - NSString *newUserString = additionalUserInfo.isNewUser ? @"new user" : @"existing user"; - return [NSString stringWithFormat:@"%@: %@", newUserString, additionalUserInfo.profile]; -} - -- (void)showTypicalUIForUserUpdateResultsWithTitle:(NSString *)resultsTitle - error:(NSError * _Nullable)error { - if (error) { - NSString *message = [NSString stringWithFormat:@"%@ (%ld)\n%@", - error.domain, - (long)error.code, - error.localizedDescription]; - if (error.code == FIRAuthErrorCodeAccountExistsWithDifferentCredential) { - NSString *errorEmail = error.userInfo[FIRAuthErrors.userInfoEmailKey]; - resultsTitle = [NSString stringWithFormat:@"Existing email : %@", errorEmail]; - } - [self showMessagePromptWithTitle:resultsTitle - message:message - showCancelButton:NO - completion:nil]; - return; - } - [self updateUserInfo]; -} - -- (void)showUIForAuthDataResultWithResult:(FIRAuthDataResult *)result - error:(NSError * _Nullable)error { - NSString *errorMessage = [NSString stringWithFormat:@"%@ (%ld)\n%@", - error.domain ?: @"", - (long)error.code, - error.localizedDescription ?: @""]; - [self showMessagePromptWithTitle:@"Error" - message:errorMessage - showCancelButton:NO - completion:^(BOOL userPressedOK, - NSString *_Nullable userInput) { - [self showMessagePromptWithTitle:@"Profile Info" - message:[self stringWithAdditionalUserInfo:result.additionalUserInfo] - showCancelButton:NO - completion:nil]; - [self updateUserInfo]; - }]; -} - -- (void)updateUserInfo { - [_userInfoTableViewCell updateContentsWithUser:[AppManager auth].currentUser]; - [_userInMemoryInfoTableViewCell updateContentsWithUser:_userInMemory]; -} - -- (void)authStateChangedForAuth:(NSNotification *)notification { - [self updateUserInfo]; - if (notification) { - [self log:[NSString stringWithFormat: - @"received FIRAuthStateDidChange notification on user '%@'.", - ((FIRAuth *)notification.object).currentUser.uid]]; - } -} - -- (void)authenticateWithSecondFactorError:(NSError * _Nullable)error - workflow:(NSString *)workflow{ - FIRMultiFactorResolver *resolver = error.userInfo[FIRAuthErrorUserInfoMultiFactorResolverKey]; - NSMutableString *displayNameString = [NSMutableString string]; - for (FIRMultiFactorInfo *tmpFactorInfo in resolver.hints) { - [displayNameString appendString:tmpFactorInfo.displayName]; - [displayNameString appendString:@" "]; - } - [self showTextInputPromptWithMessage:[NSString stringWithFormat:@"Select factor to %@\n%@", workflow, displayNameString] - completionBlock:^(BOOL userPressedOK, NSString *_Nullable displayName) { - FIRMultiFactorInfo* selectedHint; - for (FIRMultiFactorInfo *tmpFactorInfo in resolver.hints) { - if ([displayName isEqualToString:tmpFactorInfo.displayName]) { - selectedHint = tmpFactorInfo; - } - } - if ([selectedHint.factorID isEqualToString:@"phone"]) { - [FIRPhoneAuthProvider.provider - verifyPhoneNumberWithMultiFactorInfo:(FIRPhoneMultiFactorInfo *)selectedHint - UIDelegate:nil - multiFactorSession:resolver.session - completion:^(NSString * _Nullable verificationID, NSError * _Nullable error) { - if (error) { - [self logFailure:[NSString stringWithFormat:@"Multi factor start %@ failed.", workflow] error:error]; - } else { - [self showTextInputPromptWithMessage:[NSString stringWithFormat:@"Verification code for %@", selectedHint.displayName] - completionBlock:^(BOOL userPressedOK, NSString *_Nullable verificationCode) { - FIRPhoneAuthCredential *credential = - [[FIRPhoneAuthProvider provider] credentialWithVerificationID:verificationID - verificationCode:verificationCode]; - FIRMultiFactorAssertion *assertion = [FIRPhoneMultiFactorGenerator assertionWithCredential:credential]; - [resolver resolveSignInWithAssertion:assertion completion:^(FIRAuthDataResult * _Nullable authResult, NSError * _Nullable error) { - if (error) { - [self logFailure:[NSString stringWithFormat:@"Phone Multi factor finalize %@ failed.", workflow] error:error]; - } else { - [self logSuccess:[NSString stringWithFormat:@"Phone Multi factor finalize %@ succeeded.", workflow]]; - } - }]; - }]; - } - }]; - } else if ([selectedHint.factorID isEqualToString:@"totp"]) { - [self showTextInputPromptWithMessage:[NSString stringWithFormat:@"TOTP Verification code for %@", selectedHint.displayName] - completionBlock:^(BOOL userPressedOK, NSString *_Nullable oneTimePassword) { - FIRMultiFactorAssertion *assertion = [FIRTOTPMultiFactorGenerator assertionForSignInWithEnrollmentID:selectedHint.UID oneTimePassword:oneTimePassword]; - [resolver resolveSignInWithAssertion:assertion - completion:^(FIRAuthDataResult *_Nullable authResult, - NSError *_Nullable error) { - if (error) { - [self logFailure:[NSString stringWithFormat:@"TOTP Multi factor finalize %@ failed.", workflow] error:error]; - } else { - [self logSuccess:[NSString stringWithFormat:@"TOTP Multi factor finalize %@ succeeded.", workflow]]; - } - }]; - }]; - } - else { - [self log:[NSString stringWithFormat:@"Multi factor sign in does not support factor ID: %@", selectedHint.factorID]]; - } - }]; -} - -- (void)log:(NSString *)string { - dispatch_async(dispatch_get_main_queue(), ^{ - NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; - dateFormatter.dateFormat = @"yyyy-MM-dd HH:mm:ss"; - NSString *date = [dateFormatter stringFromDate:[NSDate date]]; - if (!self->_consoleString) { - self->_consoleString = [NSMutableString string]; - } - [self->_consoleString appendString:[NSString stringWithFormat:@"%@ %@\n", date, string]]; - self->_consoleTextView.text = self->_consoleString; - - CGRect targetRect = CGRectMake(0, self->_consoleTextView.contentSize.height - 1, 1, 1); - [self->_consoleTextView scrollRectToVisible:targetRect animated:YES]; - }); -} - -- (void)logSuccess:(NSString *)string { - [self log:[NSString stringWithFormat:@"SUCCESS: %@", string]]; -} - -- (void)logFailure:(NSString *)string error:(NSError * _Nullable) error { - NSString *message = - [NSString stringWithFormat:@"FAILURE: %@ Error Description: %@.", string, error.description]; - [self log:message]; -} - -- (void)logFailedTest:( NSString *_Nonnull )reason { - [self log:[NSString stringWithFormat:@"FAILIURE: TEST FAILED - %@", reason]]; -} - -#pragma mark - IBAction - -- (IBAction)userToUseDidChange:(UISegmentedControl *)sender { - _useUserInMemory = (sender.selectedSegmentIndex == 1); -} - -- (IBAction)memoryPlus { - _userInMemory = [AppManager auth].currentUser; - [self updateUserInfo]; -} - -- (IBAction)memoryClear { - _userInMemory = nil; - [self updateUserInfo]; -} - -- (IBAction)clearConsole:(id)sender { - [_consoleString appendString:@"\n\n"]; - _consoleTextView.text = @""; -} - -- (IBAction)copyConsole:(id)sender { - UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; - pasteboard.string = _consoleString ?: @""; -} - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/MainViewController.xib b/FirebaseAuth/Tests/Sample/Sample/MainViewController.xib deleted file mode 100644 index ac5a82f9eec..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/MainViewController.xib +++ /dev/null @@ -1,334 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/FirebaseAuth/Tests/Sample/Sample/SampleTemplate.entitlements b/FirebaseAuth/Tests/Sample/Sample/SampleTemplate.entitlements deleted file mode 100644 index 87371f3fdc0..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/SampleTemplate.entitlements +++ /dev/null @@ -1,14 +0,0 @@ - - - - - application-identifier - $(AppIdentifierPrefix)$(CFBundleIdentifier) - aps-environment - development - com.apple.developer.associated-domains - - applinks:$KAPP_LINKS_DOMAIN - - - diff --git a/FirebaseAuth/Tests/Sample/Sample/SettingsViewController.h b/FirebaseAuth/Tests/Sample/Sample/SettingsViewController.h deleted file mode 100644 index 3c8467e48c0..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/SettingsViewController.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -@class StaticContentTableViewManager; - -/** @class SettingsViewController - @brief A view controller for sample app info and settings. - */ -@interface SettingsViewController : UIViewController - -/** @property tableViewManager - @brief A @c StaticContentTableViewManager which is used to manage the contents of the table - view. - */ -@property(nonatomic, strong) IBOutlet StaticContentTableViewManager *tableViewManager; - -/** @fn done - @brief Called when user taps the "Done" button. - */ -- (IBAction)done:(id)sender; - -@end diff --git a/FirebaseAuth/Tests/Sample/Sample/SettingsViewController.m b/FirebaseAuth/Tests/Sample/Sample/SettingsViewController.m deleted file mode 100644 index 08b24166a87..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/SettingsViewController.m +++ /dev/null @@ -1,426 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "SettingsViewController.h" - -#import - -#import "AppManager.h" -@import FirebaseAuth; -#import -#import -#import -#import -#import "StaticContentTableViewManager.h" -#import "UIViewController+Alerts.h" - -/** @var kIdentityToolkitRequestClassName - @brief The class name of Identity Toolkit requests. - */ -static NSString *const kIdentityToolkitRequestClassName = @"IdentityToolkitRequest"; - -/** @var kSecureTokenRequestClassName - @brief The class name of Secure Token Service requests. - */ -static NSString *const kSecureTokenRequestClassName = @"SecureTokenRequest"; - -/** @var kIdentityToolkitSandboxHost - @brief The host of Identity Toolkit sandbox server. - */ -static NSString *const kIdentityToolkitSandboxHost = @"staging-www.sandbox.googleapis.com"; - -/** @var kSecureTokenSandboxHost - @brief The host of Secure Token Service sandbox server. - */ -static NSString *const kSecureTokenSandboxHost = @"staging-securetoken.sandbox.googleapis.com"; - -/** @var kGoogleServiceInfoPlists - @brief a C-array of plist file base names of Google service info to initialize FIRApp. - */ -static NSString *const kGoogleServiceInfoPlists[] = { - @"GoogleService-Info", - @"GoogleService-Info_multi" -}; - -/** @var kSharedKeychainAccessGroup - @brief The shared keychain access group for testing. - */ -static NSString *const kSharedKeychainAccessGroup = @"com.google.firebase.auth.keychainGroup1"; - -/** @var gAPIEndpoints - @brief List of API Hosts by request class name. - */ -static NSDictionary *> *gAPIHosts; - -/** @var gFirebaseAppOptions - @brief List of FIROptions. - */ -static NSArray *gFirebaseAppOptions; - -/** @protocol RequestClass - @brief A de-facto protocol followed by request class objects to access its API host. - */ -@protocol RequestClass -- (NSString *)host; -- (void)setHost:(NSString *)host; -@end - -/** @fn requestHost - @brief Retrieves the API host for the request class. - @param requestClassName The name of the request class. - */ -static NSString *APIHost(NSString *requestClassName) { - return [(id)NSClassFromString(requestClassName) host]; -} - -/** @fn truncatedString - @brief Truncates a string under a maximum length. - @param string The original string to be truncated. - @param length The maximum length of the truncated string. - @return The truncated string, which is not longer than @c length. - */ -static NSString *truncatedString(NSString *string, NSUInteger length) { - if (string.length <= length) { - return string; - } - NSUInteger half = (length - 3) / 2; - return [NSString stringWithFormat:@"%@...%@", - [string substringToIndex:half], - [string substringFromIndex:string.length - half]]; -} - -@implementation SettingsViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - [self setUpAPIHosts]; - [self setUpFirebaseAppOptions]; - [self loadTableView]; -} - -- (IBAction)done:(id)sender { - [self dismissViewControllerAnimated:YES completion:nil]; -} - -// TODO: This reliance on `NSClassFromString` crashes with the Swift implementation. - -- (void)setUpAPIHosts { - if (gAPIHosts) { - return; - } - gAPIHosts = @{ - kIdentityToolkitRequestClassName : @[ - APIHost(kIdentityToolkitRequestClassName), - kIdentityToolkitSandboxHost, - ], - kSecureTokenRequestClassName : @[ - APIHost(kSecureTokenRequestClassName), - kSecureTokenSandboxHost, - ], - }; -} - -- (void)setUpFirebaseAppOptions { - if (gFirebaseAppOptions) { - return; - } - int numberOfOptions = sizeof(kGoogleServiceInfoPlists) / sizeof(*kGoogleServiceInfoPlists); - NSMutableArray *appOptions = [[NSMutableArray alloc] initWithCapacity:numberOfOptions]; - for (int i = 0; i < numberOfOptions; i++) { - NSString *plistFileName = kGoogleServiceInfoPlists[i]; - NSString *plistFilePath = [[NSBundle mainBundle] pathForResource:plistFileName - ofType:@"plist"]; - FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:plistFilePath]; - [appOptions addObject:options]; - } - gFirebaseAppOptions = [appOptions copy]; -} - -- (void)loadTableView { - NSString *appIdentifierPrefix = NSBundle.mainBundle.infoDictionary[@"AppIdentifierPrefix"]; - NSString *fullKeychainAccessGroup = [appIdentifierPrefix stringByAppendingString:kSharedKeychainAccessGroup]; - - __weak typeof(self) weakSelf = self; - _tableViewManager.contents = [StaticContentTableViewContent contentWithSections:@[ - [StaticContentTableViewSection sectionWithTitle:@"Versions" cells:@[ - [StaticContentTableViewCell cellWithTitle:@"FirebaseAuth" - value:FIRFirebaseVersion()], - ]], - [StaticContentTableViewSection sectionWithTitle:@"API Hosts" cells:@[ - [StaticContentTableViewCell cellWithTitle:@"Identity Toolkit" - value:APIHost(kIdentityToolkitRequestClassName) - action:^{ - [weakSelf toggleAPIHostWithRequestClassName:kIdentityToolkitRequestClassName]; - }], - [StaticContentTableViewCell cellWithTitle:@"Secure Token" - value:APIHost(kSecureTokenRequestClassName) - action:^{ - [weakSelf toggleAPIHostWithRequestClassName:kSecureTokenRequestClassName]; - }], - ]], - [StaticContentTableViewSection sectionWithTitle:@"Firebase Apps" cells:@[ - [StaticContentTableViewCell cellWithTitle:@"Active App" - value:[self activeAppDescription] - action:^{ - [weakSelf toggleActiveApp]; - }], - [StaticContentTableViewCell cellWithTitle:@"Default App" - value:[self projectIDForAppAtIndex:0] - action:^{ - [weakSelf toggleProjectForAppAtIndex:0]; - }], - [StaticContentTableViewCell cellWithTitle:@"Other App" - value:[self projectIDForAppAtIndex:1] - action:^{ - [weakSelf toggleProjectForAppAtIndex:1]; - }], - ]], - [StaticContentTableViewSection sectionWithTitle:@"Keychain Access Groups" cells:@[ - [StaticContentTableViewCell cellWithTitle:@"Current Access Group" - value:[AppManager auth].userAccessGroup ? [AppManager auth].userAccessGroup : @"[none]" - ], - [StaticContentTableViewCell cellWithTitle:@"Default Group" - value:@"[none]" - action:^{ - [[AppManager auth] useUserAccessGroup:nil error:nil]; - [self loadTableView]; - }], - [StaticContentTableViewCell cellWithTitle:@"Shared Group" - value:fullKeychainAccessGroup - action:^{ - [[AppManager auth] useUserAccessGroup:fullKeychainAccessGroup error:nil]; - [self loadTableView]; - }], - ]], - [StaticContentTableViewSection sectionWithTitle:@"Phone Auth" cells:@[ - [StaticContentTableViewCell cellWithTitle:@"APNs Token" - value:[self APNSTokenString] - action:^{ - [weakSelf clearAPNSToken]; - }], - [StaticContentTableViewCell cellWithTitle:@"App Credential" - value:[self appCredentialString] - action:^{ - [weakSelf clearAppCredential]; - }], - ]], - [StaticContentTableViewSection sectionWithTitle:@"Language" cells:@[ - [StaticContentTableViewCell cellWithTitle:@"Auth Language" - value:[AppManager auth].languageCode ?: @"[none]" - action:^{ - [weakSelf showLanguageInput]; - }], - [StaticContentTableViewCell cellWithTitle:@"Use App language" action:^{ - [[AppManager auth] useAppLanguage]; - [weakSelf loadTableView]; - }], - ]], - [StaticContentTableViewSection sectionWithTitle:@"Auth Settings" cells:@[ - [StaticContentTableViewCell cellWithTitle:@"Disable App Verification (Phone)" - value:[AppManager auth].settings. - appVerificationDisabledForTesting ? @"Yes" : @"No" - action:^{ - [weakSelf toggleDisableAppVerification]; - [weakSelf loadTableView]; - }], - ]], - ]]; -} - -/** @fn toggleDisableAppVerification - @brief Toggles the appVerificationDisabledForTesting flag on the current Auth instance. - */ -- (void)toggleDisableAppVerification { - [AppManager auth].settings.appVerificationDisabledForTesting = - ![AppManager auth].settings.appVerificationDisabledForTesting; -} - -/** @fn toggleAPIHostWithRequestClassName: - @brief Toggles the host name of the server that handles RPCs. - @param requestClassName The name of the RPC request class. - */ -- (void)toggleAPIHostWithRequestClassName:(NSString *)requestClassName { - NSString *currentHost = APIHost(requestClassName); - NSArray *allHosts = gAPIHosts[requestClassName]; - NSString *newHost = allHosts[([allHosts indexOfObject:currentHost] + 1) % allHosts.count]; - [(id)NSClassFromString(requestClassName) setHost:newHost]; - [self loadTableView]; -} - -/** @fn activeAppDescription - @brief Returns the description for the currently active Firebase app. - */ -- (NSString *)activeAppDescription { - return [AppManager sharedInstance].active == 0 ? @"[Default]" : @"[Other]"; -} - -/** @fn toggleActiveApp - @brief Toggles the active Firebase app for the rest of the application. - */ -- (void)toggleActiveApp { - AppManager *apps = [AppManager sharedInstance]; - // This changes the FIRAuth instance returned from `[AppManager auth]` to be one that is - // associated with a different `FIRApp` instance. The sample app uses `[AppManager auth]` - // instead of `[FIRAuth auth]` almost everywhere. Thus, this statement switches between default - // and non-default `FIRApp` instances for the sample app to test against. - apps.active = (apps.active + 1) % apps.count; - [self loadTableView]; -} - -/** @fn projectIDForAppAtIndex: - @brief Returns the Firebase project ID for the Firebase app at the given index. - @param index The index for the app in the app manager. - @return The ID of the project. - */ -- (NSString *)projectIDForAppAtIndex:(int)index { - NSString *APIKey = [[AppManager sharedInstance] appAtIndex:index].options.APIKey; - for (FIROptions *options in gFirebaseAppOptions) { - if ([options.APIKey isEqualToString:APIKey]) { - return options.projectID; - } - } - return @"[none]"; -} - -/** @fn projectIDForAppAtIndex: - @brief Returns the Firebase project ID for the Firebase app at the given index. - @param index The index for the app in the app manager. - @return The ID of the project. - */ -- (NSString *)keychainAccessGroupAtIndex:(int)index { - NSArray *array = @[@"123", @"456"]; - return array[index]; -} - -/** @fn toggleProjectForAppAtIndex: - @brief Toggles the Firebase project for the Firebase app at the given index by recreating the - FIRApp instance with different options. - @param index The index for the app to be recreated in the app manager. - */ -- (void)toggleProjectForAppAtIndex:(int)index { - NSString *APIKey = [[AppManager sharedInstance] appAtIndex:index].options.APIKey; - int optionIndex; - for (optionIndex = 0; optionIndex < gFirebaseAppOptions.count; optionIndex++) { - FIROptions *options = gFirebaseAppOptions[optionIndex]; - if ([options.APIKey isEqualToString:APIKey]) { - break; - } - } - - FIROptions *options; - if (index == 0) { - // For default apps, the next options cannot be `nil`. - optionIndex = (optionIndex + 1) % gFirebaseAppOptions.count; - options = gFirebaseAppOptions[optionIndex]; - } else { - // For non-default apps, `nil` is considered the next options after the last options in the array. - optionIndex = (optionIndex + 1) % (gFirebaseAppOptions.count + 1); - if (optionIndex != gFirebaseAppOptions.count) { - options = gFirebaseAppOptions[optionIndex]; - } - } - __weak typeof(self) weakSelf = self; - [[AppManager sharedInstance] recreateAppAtIndex:index withOptions:options completion:^() { - dispatch_async(dispatch_get_main_queue(), ^() { - [weakSelf loadTableView]; - }); - }]; -} - -/** @fn APNSTokenString - @brief Returns a string representing APNS token. - */ -- (NSString *)APNSTokenString { - FIRAuthAPNSToken *token = [AppManager auth].tokenManager.token; - if (!token) { - return @""; - } - return [NSString stringWithFormat:@"%@(%@)", - truncatedString(token.string, 19), - token.type == FIRAuthAPNSTokenTypeProd ? @"P" : @"S"]; -} - -/** @fn clearAPNSToken - @brief Clears the saved app credential. - */ -- (void)clearAPNSToken { - FIRAuthAPNSToken *token = [AppManager auth].tokenManager.token; - if (!token) { - return; - } - NSString *tokenType = token.type == FIRAuthAPNSTokenTypeProd ? @"Production" : @"Sandbox"; - NSString *message = [NSString stringWithFormat:@"token: %@\ntype: %@", - token.string, tokenType]; - [self showMessagePromptWithTitle:@"Clear APNs Token?" - message:message - showCancelButton:YES - completion:^(BOOL userPressedOK, NSString *_Nullable userInput) { - if (userPressedOK) { - [AppManager auth].tokenManager.token = nil; - [self loadTableView]; - } - }]; -} - -/** @fn appCredentialString - @brief Returns a string representing app credential. - */ -- (NSString *)appCredentialString { - FIRAuthAppCredential *credential = [AppManager auth].appCredentialManager.credential; - if (!credential) { - return @""; - } - return [NSString stringWithFormat:@"%@/%@", - truncatedString(credential.receipt, 13), - truncatedString(credential.secret, 13)]; -} - -/** @fn clearAppCredential - @brief Clears the saved app credential. - */ -- (void)clearAppCredential { - FIRAuthAppCredential *credential = [AppManager auth].appCredentialManager.credential; - if (!credential) { - return; - } - NSString *message = [NSString stringWithFormat:@"receipt: %@\nsecret: %@", - credential.receipt, credential.secret]; - [self showMessagePromptWithTitle:@"Clear App Credential?" - message:message - showCancelButton:YES - completion:^(BOOL userPressedOK, NSString *_Nullable userInput) { - if (userPressedOK) { - [[AppManager auth].appCredentialManager clearCredential]; - [self loadTableView]; - } - }]; -} - -/** @fn showLanguageInput - @brief Show language code input field. - */ -- (void)showLanguageInput { - [self showTextInputPromptWithMessage:@"Enter Language Code For Auth:" - completionBlock:^(BOOL userPressedOK, NSString *_Nullable languageCode) { - if (!userPressedOK) { - return; - } - [AppManager auth].languageCode = languageCode.length ? languageCode : nil; - [self loadTableView]; - }]; -} - -@end diff --git a/FirebaseAuth/Tests/Sample/Sample/SettingsViewController.xib b/FirebaseAuth/Tests/Sample/Sample/SettingsViewController.xib deleted file mode 100644 index 327453c5bd3..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/SettingsViewController.xib +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/FirebaseAuth/Tests/Sample/Sample/StaticContentTableViewManager.h b/FirebaseAuth/Tests/Sample/Sample/StaticContentTableViewManager.h deleted file mode 100644 index b6afa96ff35..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/StaticContentTableViewManager.h +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#pragma mark - Forward Declarations - -@class StaticContentTableViewCell; -@class StaticContentTableViewContent; -@class StaticContentTableViewSection; - -#pragma mark - Block Type Definitions - -/** @typedef StaticContentTableViewCellAction - @brief The type of block invoked when a cell is tapped. - */ -typedef void(^StaticContentTableViewCellAction)(void); - -#pragma mark - - -/** @class StaticContentTableViewManager - @brief Generic class useful for populating a @c UITableView with static content. - @remarks Because I keep writing the same UITableView code for every internal testing app, and - it's getting too tedious and ugly to keep writing the same thing over and over. It makes - our sample apps harder to maintain with all this code sprinkled around everywhere, and - we end up cutting corners and making junky testing apps, and spending more time in the - process. - */ -@interface StaticContentTableViewManager : NSObject - -/** @property contents - @brief The static contents of the @c UITableView. - @remarks Setting this property will reload the @c UITableView. - */ -@property(nonatomic, strong, nullable) StaticContentTableViewContent *contents; - -/** @property tableView - @brief A reference to the managed @c UITableView. - @remarks This is needed to automatically reload the table view when the @c contents are changed. - */ -@property(nonatomic, weak, nullable) IBOutlet UITableView *tableView; - -@end - -#pragma mark - - -/** @class StaticContentTableViewContent - @brief Represents the contents of a @c UITableView. - */ -@interface StaticContentTableViewContent : NSObject - -/** @property sections - @brief The sections for the @c UITableView. - */ -@property(nonatomic, copy, readonly, nullable) NSArray *sections; - -/** @fn contentWithSections: - @brief Convenience factory method for creating a new instance of - @c StaticContentTableViewContent. - @param sections The sections for the @c UITableView. - */ -+ (nullable instancetype)contentWithSections: - (nullable NSArray *)sections; - -/** @fn init - @brief Please use initWithSections: - */ -- (nullable instancetype)init NS_UNAVAILABLE; - -/** @fn initWithSections: - @brief Designated initializer. - @param sections The sections in the @c UITableView. - */ -- (nullable instancetype)initWithSections: - (nullable NSArray *)sections; - -@end - -#pragma mark - - -/** @class StaticContentTableViewSection - @brief Represents a section in a @c UITableView. - @remarks Each section has a title (used for the section title in the @c UITableView) and an - array of cells. - */ -@interface StaticContentTableViewSection : NSObject - -/** @property title - @brief The title of the section in the @c UITableView. - */ -@property(nonatomic, copy, readonly, nullable) NSString *title; - -/** @property cells - @brief The cells in this section of the @c UITableView. - */ -@property(nonatomic, copy, readonly, nullable) NSArray *cells; - -/** @fn sectionWithTitle:cells: - @brief Convenience factory method for creating a new instance of - @c StaticContentTableViewSection. - @param title The title of the section in the @c UITableView. - @param cells The cells in this section of the @c UITableView. - */ -+ (nullable instancetype)sectionWithTitle:(nullable NSString *)title - cells:(nullable NSArray *)cells; - -/** @fn init - @brief Please use initWithTitle:cells: - */ -- (nullable instancetype)init NS_UNAVAILABLE; - -/** @fn initWithTitle:cells: - @brief Designated initializer. - @param title The title of the section in the @c UITableView. - @param cells The cells in this section of the @c UITableView. - */ -- (nullable instancetype)initWithTitle:(nullable NSString *)title - cells:(nullable NSArray *)cells; - -@end - -#pragma mark - - -/** @class StaticContentTableViewCell - @brief Represents a cell in a @c UITableView. - @remarks Cells may be custom cells (in which you specify a @c UITableViewCell to use), or - simple single-label cells which you supply the title text for. It does not make sense to - specify both @c customCell and also @c title, but if a @c customCell is specified, it will - be used instead of the @c title. - */ -@interface StaticContentTableViewCell : NSObject - -/** @property customCell - @brief The custom @c UITableViewCell to use for this cell. - */ -@property(nonatomic, strong, readonly, nullable) UITableViewCell *customCell; - -/** @property title - @brief If no custom cell is being used, this is the text of the @c titleLabel of the - @c UITableViewCell. - */ -@property(nonatomic, copy, readonly, nullable) NSString *title; - -/** @property value - @brief If no custom cell is being used, this is the text of the @c detailTextLabel of the - @c UITableViewCell. - */ -@property(nonatomic, copy, readonly, nullable) NSString *value; - -/** @property accessibilityIdentifier - @brief The accessibility ID for the corresponding @c UITableViewCell. - */ -@property(nonatomic, copy, readonly, nullable) NSString *accessibilityIdentifier; - -/** @property action - @brief A block which is executed when the cell is selected. - @remarks Avoid retain cycles. Since these blocked are retained here, and your - @c UIViewController's object graph likely retains this object, you don't want these blocks - to retain your @c UIViewController. The easiest thing is just to create a weak reference to - your @c UIViewController and pass it a message as the only thing the block does. - */ -@property(nonatomic, copy, readonly, nullable) StaticContentTableViewCellAction action; - -/** @fn cellWithTitle: - @brief Convenience factory method for a new instance of @c StaticContentTableViewCell. - @param title The text of the @c titleLabel of the @c UITableViewCell. - */ -+ (nullable instancetype)cellWithTitle:(nullable NSString *)title; - -/** @fn cellWithTitle:value: - @brief Convenience factory method for a new instance of @c StaticContentTableViewCell. - @param title The text of the @c titleLabel of the @c UITableViewCell. - @param value The text of the @c detailTextLabel of the @c UITableViewCell. - */ -+ (nullable instancetype)cellWithTitle:(nullable NSString *)title - value:(nullable NSString *)value; - -/** @fn cellWithTitle:action: - @brief Convenience factory method for a new instance of @c StaticContentTableViewCell. - @param title The text of the @c titleLabel of the @c UITableViewCell. - @param action A block which is executed when the cell is selected. - */ -+ (nullable instancetype)cellWithTitle:(nullable NSString *)title - action:(nullable StaticContentTableViewCellAction)action; - -/** @fn cellWithTitle:value:action: - @brief Convenience factory method for a new instance of @c StaticContentTableViewCell. - @param title The text of the @c titleLabel of the @c UITableViewCell. - @param value The text of the @c detailTextLabel of the @c UITableViewCell. - @param action A block which is executed when the cell is selected. - */ -+ (nullable instancetype)cellWithTitle:(nullable NSString *)title - value:(nullable NSString *)value - action:(nullable StaticContentTableViewCellAction)action; - -/** @fn cellWithTitle:value:action:accessibilityLabel: - @brief Convenience factory method for a new instance of @c StaticContentTableViewCell. - @param title The text of the @c titleLabel of the @c UITableViewCell. - @param value The text of the @c detailTextLabel of the @c UITableViewCell. - @param action A block which is executed when the cell is selected. - @param accessibilityID The accessibility ID to add to the cell. - */ -+ (nullable instancetype)cellWithTitle:(nullable NSString *)title - value:(nullable NSString *)value - action:(nullable StaticContentTableViewCellAction)action - accessibilityID:(nullable NSString *)accessibilityID; - -/** @fn cellWithCustomCell: - @brief Convenience factory method for a new instance of @c StaticContentTableViewCell. - @param customCell The custom @c UITableViewCell to use for this cell. - */ -+ (nullable instancetype)cellWithCustomCell:(nullable UITableViewCell *)customCell; - -/** @fn cellWithCustomCell:action: - @brief Convenience factory method for a new instance of @c StaticContentTableViewCell. - @param customCell The custom @c UITableViewCell to use for this cell. - @param action A block which is executed when the cell is selected. - */ -+ (nullable instancetype)cellWithCustomCell:(nullable UITableViewCell *)customCell - action:(nullable StaticContentTableViewCellAction)action; - -/** @fn init - @brief Please use initWithCustomCell:title:action: - */ -- (nullable instancetype)init NS_UNAVAILABLE; - -/** @fn initWithCustomCell:title:action: - @brief Designated initializer. - @param customCell The custom @c UITableViewCell to use for this cell. - @param title If no custom cell is being used, this is the text of the @c titleLabel of the - @c UITableViewCell. - @param action A block which is executed when the cell is selected. - @param accessibilityID The accessibility ID to add to the cell. - */ -- (nullable instancetype)initWithCustomCell:(nullable UITableViewCell *)customCell - title:(nullable NSString *)title - value:(nullable NSString *)value - action:(nullable StaticContentTableViewCellAction)action - accessibilityID:(nullable NSString *)accessibilityID - NS_DESIGNATED_INITIALIZER; - -@end diff --git a/FirebaseAuth/Tests/Sample/Sample/StaticContentTableViewManager.m b/FirebaseAuth/Tests/Sample/Sample/StaticContentTableViewManager.m deleted file mode 100644 index 2b94778ca8f..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/StaticContentTableViewManager.m +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "StaticContentTableViewManager.h" - -/** @var kCellReuseIdentitfier - @brief The reuse identifier for default style table view cell. - */ -static NSString *const kCellReuseIdentitfier = @"reuseIdentifier"; - -/** @var kCellReuseIdentitfier - @brief The reuse identifier for value style table view cell. - */ -static NSString *const kValueCellReuseIdentitfier = @"reuseValueIdentifier"; - -#pragma mark - - -@implementation StaticContentTableViewManager - -- (void)setContents:(StaticContentTableViewContent *)contents { - _contents = contents; - [self.tableView reloadData]; -} - -- (void)setTableView:(UITableView *)tableView { - _tableView = tableView; - [tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:kCellReuseIdentitfier]; -} - -#pragma mark - UITableViewDataSource - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return _contents.sections.count; -} - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return _contents.sections[section].cells.count; -} - -- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { - return _contents.sections[section].title; -} - -- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index { - return index; -} - -- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView { - NSMutableArray *sectionTitles = [NSMutableArray array]; - for (StaticContentTableViewSection *section in _contents.sections) { - [sectionTitles addObject:[section.title substringToIndex:3]]; - } - return sectionTitles; -} - -#pragma mark - UITableViewDelegate - -- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - StaticContentTableViewCell *cellData = _contents.sections[indexPath.section].cells[indexPath.row]; - if (cellData.customCell) { - return cellData.customCell.frame.size.height; - } - return 44; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView - cellForRowAtIndexPath:(NSIndexPath *)indexPath { - StaticContentTableViewCell *cellData = _contents.sections[indexPath.section].cells[indexPath.row]; - UITableViewCell *cell = cellData.customCell; - if (cell) { - return cell; - } - if (cellData.value.length) { - cell = [tableView dequeueReusableCellWithIdentifier:kValueCellReuseIdentitfier]; - if (!cell) { - cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 - reuseIdentifier:kValueCellReuseIdentitfier]; - cell.detailTextLabel.adjustsFontSizeToFitWidth = YES; - cell.detailTextLabel.minimumScaleFactor = 0.5; - } - cell.detailTextLabel.text = cellData.value; - } else { - // kCellReuseIdentitfier has already been registered. - cell = [tableView dequeueReusableCellWithIdentifier:kCellReuseIdentitfier - forIndexPath:indexPath]; - } - cell.textLabel.text = cellData.title; - cell.accessibilityIdentifier = cellData.accessibilityIdentifier; - return cell; -} - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - StaticContentTableViewCell *cellData = _contents.sections[indexPath.section].cells[indexPath.row]; - BOOL hasAssociatedAction = cellData.action != nil; - if (hasAssociatedAction) { - cellData.action(); - } - [tableView deselectRowAtIndexPath:indexPath animated:hasAssociatedAction]; -} - -@end - -#pragma mark - - -@implementation StaticContentTableViewContent - -+ (nullable instancetype)contentWithSections: - (nullable NSArray *)sections { - return [[self alloc] initWithSections:sections]; -} - -- (nullable instancetype)initWithSections: - (nullable NSArray *)sections { - self = [super init]; - if (self) { - _sections = [sections copy]; - } - return self; -} - -@end - -#pragma mark - - -@implementation StaticContentTableViewSection - -+ (nullable instancetype)sectionWithTitle:(nullable NSString *)title - cells:(nullable NSArray *)cells { - return [[self alloc] initWithTitle:title cells:cells]; -} - -- (nullable instancetype)initWithTitle:(nullable NSString *)title - cells:(nullable NSArray *)cells { - self = [super init]; - if (self) { - _title = [title copy]; - _cells = [cells copy]; - } - return self; -} - -@end - -#pragma mark - - -@implementation StaticContentTableViewCell - -+ (nullable instancetype)cellWithTitle:(nullable NSString *)title { - return [[self alloc] initWithCustomCell:nil - title:title - value:nil - action:nil - accessibilityID:nil]; -} - -+ (nullable instancetype)cellWithTitle:(nullable NSString *)title - value:(nullable NSString *)value { - return [[self alloc] initWithCustomCell:nil - title:title - value:value - action:nil - accessibilityID:nil]; -} - -+ (nullable instancetype)cellWithTitle:(nullable NSString *)title - action:(nullable StaticContentTableViewCellAction)action { - return [[self alloc] initWithCustomCell:nil - title:title - value:nil - action:action - accessibilityID:nil]; -} - -+ (nullable instancetype)cellWithTitle:(nullable NSString *)title - value:(nullable NSString *)value - action:(nullable StaticContentTableViewCellAction)action { - return [[self alloc] initWithCustomCell:nil - title:title - value:value - action:action - accessibilityID:nil]; -} - -+ (nullable instancetype)cellWithTitle:(nullable NSString *)title - value:(nullable NSString *)value - action:(nullable StaticContentTableViewCellAction)action - accessibilityID:(nullable NSString *)accessibilityID { - return [[self alloc] initWithCustomCell:nil - title:title - value:value - action:action - accessibilityID:accessibilityID]; -} - -+ (nullable instancetype)cellWithCustomCell:(nullable UITableViewCell *)customCell { - return [[self alloc] initWithCustomCell:customCell - title:nil - value:nil - action:nil - accessibilityID:nil]; -} - -+ (nullable instancetype)cellWithCustomCell:(nullable UITableViewCell *)customCell - action:(nullable StaticContentTableViewCellAction)action { - return [[self alloc] initWithCustomCell:customCell - title:nil - value:nil action:action - accessibilityID:nil]; -} - -- (nullable instancetype)initWithCustomCell:(nullable UITableViewCell *)customCell - title:(nullable NSString *)title - value:(nullable NSString *)value - action:(nullable StaticContentTableViewCellAction)action - accessibilityID:(nullable NSString *)accessibilityID { - self = [super init]; - if (self) { - _customCell = customCell; - _title = [title copy]; - _value = [value copy]; - _action = action; - if (accessibilityID) { - _accessibilityIdentifier = [accessibilityID copy]; - self.isAccessibilityElement = YES; - } - } - return self; -} - -@end diff --git a/FirebaseAuth/Tests/Sample/Sample/UIViewController+Alerts.h b/FirebaseAuth/Tests/Sample/Sample/UIViewController+Alerts.h deleted file mode 100644 index 8d7f6fa472d..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/UIViewController+Alerts.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -NS_ASSUME_NONNULL_BEGIN - -/*! @typedef AlertPromptCompletionBlock - @brief The type of callback used to report text input prompt results. - */ -typedef void (^AlertPromptCompletionBlock)(BOOL userPressedOK, NSString *_Nullable userInput); - -/*! @category UIViewController(Alerts) - @brief Wrapper for @c UIAlertController and @c UIAlertView for backwards compatibility with - iOS 6+. - */ -@interface UIViewController (Alerts) - -/*! @property useStatusBarSpinner - @brief Uses the status bar to indicate work is occuring instead of a modal "please wait" dialog. - This is generally useful for allowing user interaction while things are happening. - */ -@property(nonatomic, assign) BOOL useStatusBarSpinner; - -/*! @fn showMessagePrompt: - @brief Displays an alert with an 'OK' button and a message. - @param message The message to display. - @remarks The message is also copied to the pasteboard. - */ -- (void)showMessagePrompt:(NSString *)message; - -/*! @fn showMessagePromptWithTitle:message: - @brief Displays a titled alert with an 'OK' button and a message. - @param title The title of the alert if it exists. - @param message The message to display. - @param showCancelButton A flag indicating whether or not a cancel option is available. - @param completion The completion block to be executed after the alert is dismissed, if it - exists. - @remarks The message is also copied to the pasteboard. - */ -- (void)showMessagePromptWithTitle:(nullable NSString *)title - message:(NSString *)message - showCancelButton:(BOOL)showCancelButton - completion:(nullable AlertPromptCompletionBlock)completion; - -/*! @fn showTextInputPromptWithMessage:keyboardType:completionBlock: - @brief Shows a prompt with a text field and 'OK'/'Cancel' buttons. - @param message The message to display. - @param keyboardType The type of keyboard to display for the UITextView in the prompt. - @param completion A block to call when the user taps 'OK' or 'Cancel'. - */ -- (void)showTextInputPromptWithMessage:(NSString *)message - keyboardType:(UIKeyboardType)keyboardType - completionBlock:(AlertPromptCompletionBlock)completion; - -/*! @fn showTextInputPromptWithMessage:completionBlock: - @brief Shows a prompt with a text field and 'OK'/'Cancel' buttons. - @param message The message to display. - @param completion A block to call when the user taps 'OK' or 'Cancel'. - */ -- (void)showTextInputPromptWithMessage:(NSString *)message - completionBlock:(AlertPromptCompletionBlock)completion; - -/*! @fn showQRCodePromptWithTextInput:message:qrCodeString:completionBlock: - @brief Shows a prompt with a QR code image, text message, text field for input, and 'OK'/'Cancel' buttons. - @param message The message to display. - @param qrCodeString The string to encode as a QR code and display as an image. - @param completion A block to call when the user taps 'OK' or 'Cancel'. - */ -- (void)showQRCodePromptWithTextInput:(NSString *)message - qrCodeString:(NSString *)qrCodeString - completionBlock:(AlertPromptCompletionBlock)completion; - -/*! @fn showSpinner - @brief Shows the please wait spinner. - @param completion Called after the spinner has been hidden. - */ -- (void)showSpinner:(nullable void(^)(void))completion; - -/*! @fn hideSpinner - @brief Hides the please wait spinner. - @param completion Called after the spinner has been hidden. - */ -- (void)hideSpinner:(nullable void(^)(void))completion; - -@end - -NS_ASSUME_NONNULL_END diff --git a/FirebaseAuth/Tests/Sample/Sample/UIViewController+Alerts.m b/FirebaseAuth/Tests/Sample/Sample/UIViewController+Alerts.m deleted file mode 100644 index 49474e258d0..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/UIViewController+Alerts.m +++ /dev/null @@ -1,410 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "UIViewController+Alerts.h" - -#import - -/*! @var kPleaseWaitAssociatedObjectKey - @brief Key used to identify the "please wait" spinner associated object. - */ -static NSString *const kPleaseWaitAssociatedObjectKey = - @"_UIViewControllerAlertCategory_PleaseWaitScreenAssociatedObject"; - -/*! @var kUseStatusBarSpinnerAssociatedObjectKey - @brief The address of this constant is the key used to identify the "use status bar spinner" - associated object. - */ -static const void *const kUseStatusBarSpinnerAssociatedObjectKey; - -/*! @var kOK - @brief Text for an 'OK' button. - */ -static NSString *const kOK = @"OK"; - -/*! @var kCancel - @brief Text for an 'Cancel' button. - */ -static NSString *const kCancel = @"Cancel"; - -/*! @class SimpleTextPromptDelegate - @brief A @c UIAlertViewDelegate which allows @c UIAlertView to be used with blocks more easily. - */ -@interface SimpleTextPromptDelegate : NSObject - -/*! @fn init - @brief Please use initWithCompletionHandler. - */ -- (nullable instancetype)init NS_UNAVAILABLE; - -/*! @fn initWithCompletionHandler: - @brief Designated initializer. - @param completionHandler The block to call when the alert view is dismissed. - */ -- (nullable instancetype)initWithCompletionHandler:(AlertPromptCompletionBlock)completionHandler - NS_DESIGNATED_INITIALIZER; - -@end - -@implementation UIViewController (Alerts) - -- (void)setUseStatusBarSpinner:(BOOL)useStatusBarSpinner { - objc_setAssociatedObject(self, - &kUseStatusBarSpinnerAssociatedObjectKey, - useStatusBarSpinner ? @(YES) : nil, - OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -- (BOOL)useStatusBarSpinner { - return objc_getAssociatedObject(self, &kUseStatusBarSpinnerAssociatedObjectKey) ? YES : NO; -} - -/*! @fn supportsAlertController - @brief Determines if the current platform supports @c UIAlertController. - @return YES if the current platform supports @c UIAlertController. - */ -- (BOOL)supportsAlertController { - return NSClassFromString(@"UIAlertController") != nil; -} - -- (void)showMessagePrompt:(NSString *)message { - [self showMessagePromptWithTitle:nil message:message showCancelButton:NO completion:nil]; -} - -- (void)showMessagePromptWithTitle:(nullable NSString *)title - message:(NSString *)message - showCancelButton:(BOOL)showCancelButton - completion:(nullable AlertPromptCompletionBlock)completion { - if (message) { - [UIPasteboard generalPasteboard].string = message; - } - if ([self supportsAlertController]) { - UIAlertController *alert = - [UIAlertController alertControllerWithTitle:title - message:message - preferredStyle:UIAlertControllerStyleAlert]; - UIAlertAction *okAction = - [UIAlertAction actionWithTitle:kOK - style:UIAlertActionStyleDefault - handler:^(UIAlertAction * _Nonnull action) { - if (completion) { - completion(YES, nil); - } - }]; - [alert addAction:okAction]; - - if (showCancelButton) { - UIAlertAction *cancelAction = - [UIAlertAction actionWithTitle:kCancel - style:UIAlertActionStyleCancel - handler:^(UIAlertAction * _Nonnull action) { - completion(NO, nil); - }]; - [alert addAction:cancelAction]; - } - [self presentViewController:alert animated:YES completion:nil]; - } else { - UIAlertController* alert = [UIAlertController alertControllerWithTitle:title - message:message - preferredStyle:UIAlertControllerStyleAlert]; - [self presentViewController:alert animated:YES completion:nil]; - } -} - -- (void)showTextInputPromptWithMessage:(NSString *)message - completionBlock:(AlertPromptCompletionBlock)completion { - [self showTextInputPromptWithMessage:message - keyboardType:UIKeyboardTypeDefault - completionBlock:completion]; -} - -- (void)showTextInputPromptWithMessage:(NSString *)message - keyboardType:(UIKeyboardType)keyboardType - completionBlock:(nonnull AlertPromptCompletionBlock)completion { - if ([self supportsAlertController]) { - UIAlertController *prompt = - [UIAlertController alertControllerWithTitle:nil - message:message - preferredStyle:UIAlertControllerStyleAlert]; - __weak UIAlertController *weakPrompt = prompt; - UIAlertAction *cancelAction = - [UIAlertAction actionWithTitle:kCancel - style:UIAlertActionStyleCancel - handler:^(UIAlertAction * _Nonnull action) { - completion(NO, nil); - }]; - UIAlertAction *okAction = [UIAlertAction actionWithTitle:kOK - style:UIAlertActionStyleDefault - handler:^(UIAlertAction * _Nonnull action) { - UIAlertController *strongPrompt = weakPrompt; - completion(YES, strongPrompt.textFields[0].text); - }]; - [prompt addTextFieldWithConfigurationHandler:^(UITextField *_Nonnull textField) { - textField.keyboardType = keyboardType; - }]; - [prompt addAction:cancelAction]; - [prompt addAction:okAction]; - [self presentViewController:prompt animated:YES completion:nil]; - } else { - SimpleTextPromptDelegate *prompt = - [[SimpleTextPromptDelegate alloc] initWithCompletionHandler:completion]; - UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil - message:message - delegate:prompt - cancelButtonTitle:@"Cancel" - otherButtonTitles:@"Ok", nil]; - alertView.alertViewStyle = UIAlertViewStylePlainTextInput; - [alertView show]; - } -} - -- (void)showQRCodePromptWithTextInput:(NSString *)message - qrCodeString:(NSString *)qrCodeString - completionBlock:(AlertPromptCompletionBlock)completion { - - // Create the QR code image from the provided string - NSData *qrCodeData = [qrCodeString dataUsingEncoding:NSUTF8StringEncoding]; - CIFilter *qrCodeFilter = [CIFilter filterWithName:@"CIQRCodeGenerator"]; - [qrCodeFilter setValue:qrCodeData forKey:@"inputMessage"]; - CIImage *qrCodeImage = qrCodeFilter.outputImage; - - // Scale the QR code image to an appropriate size - CGRect extent = qrCodeImage.extent; - CGFloat scale = MIN(240.0 / CGRectGetWidth(extent), 240.0 / CGRectGetHeight(extent)); - CIImage *scaledImage = [qrCodeImage imageByApplyingTransform:CGAffineTransformMakeScale(scale, scale)]; - UIImage *qrCodeUIImage = [UIImage imageWithCIImage:scaledImage]; - - // Create the alert controller to display the QR code and text input - UIAlertController *prompt = [UIAlertController alertControllerWithTitle:nil - message:@"\n\n\n\n\n\n\n\n\n\n" - preferredStyle:UIAlertControllerStyleAlert]; - __weak UIAlertController *weakPrompt = prompt; - UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" - style:UIAlertActionStyleCancel - handler:^(UIAlertAction * _Nonnull action) { - completion(NO, nil); - }]; - UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" - style:UIAlertActionStyleDefault - handler:^(UIAlertAction * _Nonnull action) { - UIAlertController *strongPrompt = weakPrompt; - completion(YES, strongPrompt.textFields[0].text); - }]; - [prompt addTextFieldWithConfigurationHandler:^(UITextField *_Nonnull textField) { - textField.placeholder = @"Enter OTP"; - }]; - [prompt addAction:cancelAction]; - [prompt addAction:okAction]; - - // Add the QR code image view to the alert controller - UIImageView *qrCodeImageView = [[UIImageView alloc] initWithImage:qrCodeUIImage]; - qrCodeImageView.contentMode = UIViewContentModeScaleAspectFit; - qrCodeImageView.translatesAutoresizingMaskIntoConstraints = NO; - [prompt.view addSubview:qrCodeImageView]; - [qrCodeImageView.centerXAnchor constraintEqualToAnchor:prompt.view.centerXAnchor].active = YES; - [qrCodeImageView.topAnchor constraintEqualToAnchor:prompt.view.topAnchor - constant:10.0].active = YES; - [qrCodeImageView.widthAnchor constraintEqualToConstant:240.0].active = YES; - [qrCodeImageView.heightAnchor constraintEqualToConstant:240.0].active = YES; - - // Add the message label to the alert controller - UILabel *messageLabel = [[UILabel alloc] init]; - messageLabel.text = message; - messageLabel.textAlignment = NSTextAlignmentCenter; - messageLabel.numberOfLines = 0; - messageLabel.translatesAutoresizingMaskIntoConstraints = NO; - [prompt.view addSubview:messageLabel]; - [messageLabel.topAnchor constraintEqualToAnchor:qrCodeImageView.bottomAnchor - constant:10.0].active = YES; - [messageLabel.leadingAnchor constraintEqualToAnchor:prompt.view.leadingAnchor - constant:10.0].active = YES; - [messageLabel.trailingAnchor constraintEqualToAnchor:prompt.view.trailingAnchor - constant:-10.0].active = YES; - - // Present the alert controller - [self presentViewController:prompt animated:YES completion:nil]; -} - -- (void)showSpinner:(nullable void(^)(void))completion { - if (self.useStatusBarSpinner) { - [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; - completion(); - return; - } - if ([self supportsAlertController]) { - [self showModernSpinner:completion]; - } else { - [self showIOS7Spinner:completion]; - } -} - -- (void)showModernSpinner:(nullable void (^)(void))completion { - UIAlertController *pleaseWaitAlert = - objc_getAssociatedObject(self, - (__bridge const void *)kPleaseWaitAssociatedObjectKey); - if (pleaseWaitAlert) { - if (completion) { - completion(); - } - return; - } - pleaseWaitAlert = [UIAlertController alertControllerWithTitle:nil - message:@"Please Wait...\n\n\n\n" - preferredStyle:UIAlertControllerStyleAlert]; - - UIActivityIndicatorView *spinner = - [[UIActivityIndicatorView alloc] - initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; - spinner.color = [UIColor blackColor]; - spinner.center = CGPointMake(pleaseWaitAlert.view.bounds.size.width / 2, - pleaseWaitAlert.view.bounds.size.height / 2); - spinner.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin | - UIViewAutoresizingFlexibleTopMargin | - UIViewAutoresizingFlexibleLeftMargin | - UIViewAutoresizingFlexibleRightMargin; - [spinner startAnimating]; - [pleaseWaitAlert.view addSubview:spinner]; - - objc_setAssociatedObject(self, - (__bridge const void *)(kPleaseWaitAssociatedObjectKey), - pleaseWaitAlert, - OBJC_ASSOCIATION_RETAIN_NONATOMIC); - [self presentViewController:pleaseWaitAlert animated:YES completion:completion]; -} - -- (void)showIOS7Spinner:(nullable void (^)(void))completion { - UIWindow *pleaseWaitWindow = - objc_getAssociatedObject(self, - (__bridge const void *)kPleaseWaitAssociatedObjectKey); - - if (pleaseWaitWindow) { - if (completion) { - completion(); - } - return; - } - - pleaseWaitWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - pleaseWaitWindow.backgroundColor = [UIColor clearColor]; - pleaseWaitWindow.windowLevel = UIWindowLevelStatusBar - 1; - - UIView *pleaseWaitView = [[UIView alloc] initWithFrame:pleaseWaitWindow.bounds]; - pleaseWaitView.autoresizingMask = UIViewAutoresizingFlexibleWidth | - UIViewAutoresizingFlexibleHeight; - pleaseWaitView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5]; - UIActivityIndicatorView *spinner = - [[UIActivityIndicatorView alloc] - initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; - spinner.center = pleaseWaitView.center; - [pleaseWaitView addSubview:spinner]; - [spinner startAnimating]; - - pleaseWaitView.layer.opacity = 0.0; - [self.view addSubview:pleaseWaitView]; - - [pleaseWaitWindow addSubview:pleaseWaitView]; - - [pleaseWaitWindow makeKeyAndVisible]; - - objc_setAssociatedObject(self, - (__bridge const void *)(kPleaseWaitAssociatedObjectKey), - pleaseWaitWindow, - OBJC_ASSOCIATION_RETAIN_NONATOMIC); - - [UIView animateWithDuration:0.5f animations:^{ - pleaseWaitView.layer.opacity = 1.0f; - } completion:^(BOOL finished) { - if (completion) { - completion(); - } - }]; -} - -- (void)hideSpinner:(nullable void(^)(void))completion { - if (self.useStatusBarSpinner) { - [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; - completion(); - return; - } - if ([self supportsAlertController]) { - [self hideModernSpinner:completion]; - } else { - [self hideIOS7Spinner:completion]; - } -} - -- (void)hideModernSpinner:(nullable void(^)(void))completion { - UIAlertController *pleaseWaitAlert = - objc_getAssociatedObject(self, - (__bridge const void *)kPleaseWaitAssociatedObjectKey); - - [pleaseWaitAlert dismissViewControllerAnimated:YES completion:completion]; - - objc_setAssociatedObject(self, - (__bridge const void *)(kPleaseWaitAssociatedObjectKey), - nil, - OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -- (void)hideIOS7Spinner:(nullable void(^)(void))completion { - UIWindow *pleaseWaitWindow = - objc_getAssociatedObject(self, - (__bridge const void *)kPleaseWaitAssociatedObjectKey); - - UIView *pleaseWaitView; - pleaseWaitView = pleaseWaitWindow.subviews.firstObject; - - [UIView animateWithDuration:0.5f animations:^{ - pleaseWaitView.layer.opacity = 0.0f; - } completion:^(BOOL finished) { - [pleaseWaitWindow resignKeyWindow]; - objc_setAssociatedObject(self, - (__bridge const void *)(kPleaseWaitAssociatedObjectKey), - nil, - OBJC_ASSOCIATION_RETAIN_NONATOMIC); - if (completion) { - completion(); - } - }]; -} - -@end - -@implementation SimpleTextPromptDelegate { - AlertPromptCompletionBlock _completionHandler; - SimpleTextPromptDelegate *_retainedSelf; -} - -- (instancetype)initWithCompletionHandler:(AlertPromptCompletionBlock)completionHandler { - self = [super init]; - if (self) { - _completionHandler = completionHandler; - _retainedSelf = self; - } - return self; -} - -- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex { - if (buttonIndex == alertView.firstOtherButtonIndex) { - _completionHandler(YES, [alertView textFieldAtIndex:0].text); - } else { - _completionHandler(NO, nil); - } - _completionHandler = nil; - _retainedSelf = nil; -} - -@end diff --git a/FirebaseAuth/Tests/Sample/Sample/UserInfoViewController.h b/FirebaseAuth/Tests/Sample/Sample/UserInfoViewController.h deleted file mode 100644 index 6eee27fc379..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/UserInfoViewController.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -@class FIRUser; -@class StaticContentTableViewManager; - -/** @class UserInfoViewController - @brief A view controller for displaying @c FIRUser data. - */ -@interface UserInfoViewController : UIViewController - -/** @property tableViewManager - @brief A @c StaticContentTableViewManager which is used to manage the contents of the table - view. - */ -@property(nonatomic, strong) IBOutlet StaticContentTableViewManager *tableViewManager; - -/** @fn initWithUser: - @biref Initializes with a @c FIRUser instance. - @param user The user to be displayed in the view. - */ -- (instancetype)initWithUser:(FIRUser *)user NS_DESIGNATED_INITIALIZER; - -/** @fn initWithNibName:bundle: - @brief Not available. Call initWithUser: instead. - */ -- (instancetype)initWithNibName:(NSString *)nibNameOrNil - bundle:(NSBundle *)nibBundleOrNil NS_UNAVAILABLE; - -/** @fn initWithCoder: - @brief Not available. Call initWithUser: instead. - */ -- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE; - -/** @fn done - @brief Called when user taps the "Done" button. - */ -- (IBAction)done:(id)sender; - -@end diff --git a/FirebaseAuth/Tests/Sample/Sample/UserInfoViewController.m b/FirebaseAuth/Tests/Sample/Sample/UserInfoViewController.m deleted file mode 100644 index 453c0aeb6be..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/UserInfoViewController.m +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "UserInfoViewController.h" - -@import FirebaseAuth; -#import "StaticContentTableViewManager.h" - -/** @fn stringWithBool - @brief Converts a boolean value to a string for display. - @param boolValue the boolean value. - @return The string form of the boolean value. - */ -static NSString *stringWithBool(BOOL boolValue) { - return boolValue ? @"YES" : @"NO"; -} - -/** @fn stringFromDate - @brief Converts a NSDate va to a string for display. - @param date The NSDate instance. - @return The string form of the NSDate instance. - */ -static NSString *stringFromDate(NSDate *date) { - if (!date) { - return @"nil"; - } - NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; - dateFormatter.dateStyle = NSDateFormatterShortStyle; - dateFormatter.timeStyle = NSDateFormatterShortStyle; - return [dateFormatter stringFromDate:date]; -} - -@implementation UserInfoViewController { - FIRUser *_user; -} - -- (instancetype)initWithUser:(FIRUser *)user { - self = [super initWithNibName:NSStringFromClass([self class]) bundle:nil]; - if (self) { - _user = user; - } - return self; -} - -- (void)viewDidLoad { - [super viewDidLoad]; - [self loadTableView]; -} - -- (void)loadTableView { - NSMutableArray *sections = [@[ - [StaticContentTableViewSection sectionWithTitle:@"User" cells:@[ - [StaticContentTableViewCell cellWithTitle:@"anonymous" value:stringWithBool(_user.anonymous)], - [StaticContentTableViewCell cellWithTitle:@"creation date" - value:stringFromDate(_user.metadata.creationDate)], - [StaticContentTableViewCell cellWithTitle:@"last sign in date" - value:stringFromDate(_user.metadata.lastSignInDate)], - [StaticContentTableViewCell cellWithTitle:@"email verified" - value:stringWithBool(_user.emailVerified)], - [StaticContentTableViewCell cellWithTitle:@"refresh token" value:_user.refreshToken], - [StaticContentTableViewCell cellWithTitle:@"multi factor" value:[self multiFactorString]], - ]] - ] mutableCopy]; - [sections addObject:[self sectionWithUserInfo:_user]]; - for (id userInfo in _user.providerData) { - [sections addObject:[self sectionWithUserInfo:userInfo]]; - } - _tableViewManager.contents = [StaticContentTableViewContent contentWithSections:sections]; -} - -- (StaticContentTableViewSection *)sectionWithUserInfo:(id)userInfo { - return [StaticContentTableViewSection sectionWithTitle:userInfo.providerID cells:@[ - [StaticContentTableViewCell cellWithTitle:@"uid" value:userInfo.uid], - [StaticContentTableViewCell cellWithTitle:@"displayName" value:userInfo.displayName], - [StaticContentTableViewCell cellWithTitle:@"photoURL" value:[userInfo.photoURL absoluteString]], - [StaticContentTableViewCell cellWithTitle:@"email" value:userInfo.email], - [StaticContentTableViewCell cellWithTitle:@"phoneNumber" value:userInfo.phoneNumber] - ]]; -} - -- (IBAction)done:(id)sender { - [self dismissViewControllerAnimated:YES completion:nil]; -} - -- (NSString *)multiFactorString { - NSMutableString *string = [NSMutableString string]; - - for (FIRMultiFactorInfo *info in _user.multiFactor.enrolledFactors) { - [string appendString:info.displayName]; - [string appendString:@" "]; - } - - return string; -} - -@end diff --git a/FirebaseAuth/Tests/Sample/Sample/UserInfoViewController.xib b/FirebaseAuth/Tests/Sample/Sample/UserInfoViewController.xib deleted file mode 100644 index 9098e442743..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/UserInfoViewController.xib +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/FirebaseAuth/Tests/Sample/Sample/UserTableViewCell.h b/FirebaseAuth/Tests/Sample/Sample/UserTableViewCell.h deleted file mode 100644 index bc629071634..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/UserTableViewCell.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -@class FIRUser; - -/** @class UserTableViewCell - @brief Represents a user in a table view. - */ -@interface UserTableViewCell : UITableViewCell - -/** @property userInfoProfileURLImageView - @brief A UIImageView whose image is set to the user's profile URL. - */ -@property(nonatomic, weak) IBOutlet UIImageView *userInfoProfileURLImageView; - -/** @property userInfoDisplayNameLabel - @brief A UILabel whose text is set to the user's display name. - */ -@property(nonatomic, weak) IBOutlet UILabel *userInfoDisplayNameLabel; - -/** @property userInfoEmailLabel - @brief A UILabel whose text is set to the user's email. - */ -@property(nonatomic, weak) IBOutlet UILabel *userInfoEmailLabel; - -/** @property userInfoUserIDLabel - @brief A UILabel whose text is set to the user's User ID. - */ -@property(nonatomic, weak) IBOutlet UILabel *userInfoUserIDLabel; - -/** @property userInfoProviderListLabel - @brief A UILabel whose text is set to the user's comma-delimited list of federated sign in - provider IDs. - */ -@property(nonatomic, weak) IBOutlet UILabel *userInfoProviderListLabel; - -/** @fn updateContentsWithUser: - @brief Updates the values of the controls on this table view cell to represent the user. - @param user The user whose values should be used to populate this cell. - */ -- (void)updateContentsWithUser:(FIRUser *)user; - -@end diff --git a/FirebaseAuth/Tests/Sample/Sample/UserTableViewCell.m b/FirebaseAuth/Tests/Sample/Sample/UserTableViewCell.m deleted file mode 100644 index 71ad96c045f..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/UserTableViewCell.m +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "UserTableViewCell.h" - -@import FirebaseAuth; - -@implementation UserTableViewCell { - /** @var _lastPhotoURL - @brief Used to make sure only the last requested image is used to update the UIImageView. - */ - NSURL *_lastPhotoURL; -} - -- (void)updateContentsWithUser:(FIRUser *)user { - _userInfoDisplayNameLabel.text = user.displayName; - _userInfoEmailLabel.text = user.email; - _userInfoUserIDLabel.text = user.uid; - - NSMutableArray *providerIDs = [NSMutableArray array]; - for (id userInfo in user.providerData) { - [providerIDs addObject:userInfo.providerID]; - } - _userInfoProviderListLabel.text = [providerIDs componentsJoinedByString:@", "]; - - NSURL *photoURL = user.photoURL; - _lastPhotoURL = photoURL; // to prevent eariler image overwrites later one. - if (photoURL) { - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^() { - UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:photoURL]]; - dispatch_async(dispatch_get_main_queue(), ^() { - if (photoURL == self->_lastPhotoURL) { - self->_userInfoProfileURLImageView.image = image; - } - }); - }); - } else { - _userInfoProfileURLImageView.image = nil; - } -} - -@end diff --git a/FirebaseAuth/Tests/Sample/Sample/main.m b/FirebaseAuth/Tests/Sample/Sample/main.m deleted file mode 100644 index f970dbf4250..00000000000 --- a/FirebaseAuth/Tests/Sample/Sample/main.m +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "ApplicationDelegate.h" - -int main(int argc, char *argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([ApplicationDelegate class])); - } -} From 0378a545e94b50c41c8420c41a291277687123fc Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Thu, 4 Jan 2024 13:31:59 -0800 Subject: [PATCH 2/2] review --- FirebaseAuth/Sources/Swift/Auth/Auth.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FirebaseAuth/Sources/Swift/Auth/Auth.swift b/FirebaseAuth/Sources/Swift/Auth/Auth.swift index 9d249ce907f..dcecd6dbd91 100644 --- a/FirebaseAuth/Sources/Swift/Auth/Auth.swift +++ b/FirebaseAuth/Sources/Swift/Auth/Auth.swift @@ -93,7 +93,7 @@ extension Auth: AuthInterop { strongSelf.autoRefreshTokens = true strongSelf.scheduleAutoTokenRefresh() - #if os(iOS) || os(tvOS) // TODO(from ObjC): Is a similar mechanism needed on macOS? + #if os(iOS) || os(tvOS) // TODO(ObjC): Is a similar mechanism needed on macOS? strongSelf.applicationDidBecomeActiveObserver = NotificationCenter.default.addObserver( forName: UIApplication.didBecomeActiveNotification,