diff --git a/Annict-for-iOS/Controllers/Login/CheckingLoginStateViewController.swift b/Annict-for-iOS/Controllers/Login/CheckingLoginStateViewController.swift index dafaa6b6..4a1d4a12 100644 --- a/Annict-for-iOS/Controllers/Login/CheckingLoginStateViewController.swift +++ b/Annict-for-iOS/Controllers/Login/CheckingLoginStateViewController.swift @@ -17,8 +17,15 @@ class CheckingLoginStateViewController: UIViewController { super.viewDidAppear(animated) if AnnictConsts.accessToken.isEmpty && !AppConfig.isTesting() { - let loginVC = LoginViewController.instantiate(withStoryboard: "Login") - self.present(loginVC, animated: false, completion: nil) + FIRDatabaseClient().getBoolValue(path: "isReview") { isReview in + if isReview { + let reviewLoginVC = ReviewLoginViewController.instantiate(withStoryboard: .login) + self.present(reviewLoginVC, animated: true, completion: nil) + } else { + let loginVC = LoginViewController.instantiate(withStoryboard: .login) + self.present(loginVC, animated: false, completion: nil) + } + } } else { let annictTabBarController = AnnictTabBarController.instantiate(withStoryboard: "AnnictMeWorks") self.present(annictTabBarController, animated: false, completion: nil) diff --git a/Annict-for-iOS/Controllers/Login/ReviewLoginViewController.swift b/Annict-for-iOS/Controllers/Login/ReviewLoginViewController.swift index 38827237..cb5ea180 100644 --- a/Annict-for-iOS/Controllers/Login/ReviewLoginViewController.swift +++ b/Annict-for-iOS/Controllers/Login/ReviewLoginViewController.swift @@ -8,6 +8,8 @@ import UIKit +import Keys + class ReviewLoginViewController: UIViewController { @IBOutlet dynamic fileprivate weak var IDTextField: UITextField! @@ -21,22 +23,8 @@ class ReviewLoginViewController: UIViewController { } @IBAction func tapedLoginButton(_ sender: Any) { - guard let testID = ProcessInfo.processInfo.environment["test_annict_id"] else { - assertionFailure("env['test_annict_id'] is not set.") - return - } - - guard let testPass = ProcessInfo.processInfo.environment["test_annict_pass"] else { - assertionFailure("env['test_annict_pass'] is not set.") - return - } - - if IDTextField.text == testID && passwordTextField.text == testPass { - guard let testAccessToken = ProcessInfo.processInfo.environment["test_annict_access_token"] else { - assertionFailure("env['test_annict_access_token'] is not set.") - return - } - AnnictConsts.accessToken = testAccessToken + if IDTextField.text == AnnictForIOSKeys().annictIDForReview && passwordTextField.text == AnnictForIOSKeys().annictPassForReview { + AnnictConsts.accessToken = AnnictForIOSKeys().annictAccessTokenForReview let annictTabBarController = AnnictTabBarController.instantiate(withStoryboard: "AnnictMeWorks") self.present(annictTabBarController, animated: false, completion: nil) } else { diff --git a/Annict-for-iOS/Info.plist b/Annict-for-iOS/Info.plist index a251198a..f868a84b 100644 --- a/Annict-for-iOS/Info.plist +++ b/Annict-for-iOS/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0.0 + 1.0.1 CFBundleURLTypes @@ -32,7 +32,7 @@ CFBundleVersion - 1.7 + 0 LSRequiresIPhoneOS NSAppTransportSecurity diff --git a/Podfile b/Podfile index ffc894fc..5e2437fc 100644 --- a/Podfile +++ b/Podfile @@ -26,5 +26,8 @@ plugin 'cocoapods-keys', { :keys => [ "AnnictClientID", "AnnictClientSecret", - "AnnictAccessToken" + "AnnictAccessToken", + "AnnictIDForReview", + "AnnictPassForReview", + "AnnictAccessTokenForReview" ]} diff --git a/Podfile.lock b/Podfile.lock index 9e8efc7d..d2844983 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -39,6 +39,6 @@ SPEC CHECKSUMS: GoogleToolboxForMac: 8e329f1b599f2512c6b10676d45736bcc2cbbeb0 Keys: 9c35bf00f612ee1d48556f4a4b9b4551e224e90f -PODFILE CHECKSUM: e467af81a6b243828cc7e10d75b7a8b63efd7f1d +PODFILE CHECKSUM: 88d5a3c6103123f1227c6fd8b0bff6f4d65d3875 COCOAPODS: 1.2.0 diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock index 9e8efc7d..d2844983 100644 --- a/Pods/Manifest.lock +++ b/Pods/Manifest.lock @@ -39,6 +39,6 @@ SPEC CHECKSUMS: GoogleToolboxForMac: 8e329f1b599f2512c6b10676d45736bcc2cbbeb0 Keys: 9c35bf00f612ee1d48556f4a4b9b4551e224e90f -PODFILE CHECKSUM: e467af81a6b243828cc7e10d75b7a8b63efd7f1d +PODFILE CHECKSUM: 88d5a3c6103123f1227c6fd8b0bff6f4d65d3875 COCOAPODS: 1.2.0