2017-06-12 16 views
1

私はあらゆる種類のチュートリアルに従いましたが、さまざまなことを試みましたが、助けはありませんでした。私はすべてを正しくしたと確信しています。しかし、私が電子メールでサインインしようとしているとき、Firebase(新しいユーザやデータ)には何も動いていません。また、エラーメッセージも表示されませんでした。Xcode SwiftアプリケーションをFirebaseに接続できません

ティアファイヤーベースを正しく接続できなかったと思います。 CocoapodsやXcodeやFirebaseにバージョンの不一致があるかもしれませんが、わかりませんでした。

  • cocoapods-1.2.1
  • のXcode 8.3.3
  • スウィフト3

AppDelegate:

import UIKit 
import Firebase 

@UIApplicationMain 
class AppDelegate: UIResponder, UIApplicationDelegate { 
var window: UIWindow? 


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 
    // Override point for customization after application launch. 
    FirebaseApp.configure() 
    return true 
} 

のViewController:

import UIKit 
import FirebaseAuth 

class ViewController: UIViewController { 
    @IBOutlet var emailTextField: UITextField! 
    @IBOutlet var passTextField: UITextField! 

    @IBAction func signUp(_ sender: Any) { 

     let email = emailTextField.text! 
     let password = passTextField.text! 

     Auth.auth().createUser(withEmail: email, password: password) { (user, error) in 
      if error != nil{ 
       print(String(describing: error?.localizedDescription)) 
      }else{ 
       self.performSegue(withIdentifier: "goToHome", sender: self) 
      } 

     } 
    } 

コンソール出力:

2017-06-12 05:17:22.628 emailAuth[11936] <Warning> [Firebase/Analytics][I-ACS005000] The AdSupport Framework is not currently linked. Some features will not function properly. Learn more at url.com 
2017-06-12 05:17:22.636 emailAuth[11936] <Notice> [Firebase/Analytics][I-ACS023007] Firebase Analytics v.4001000 started 
2017-06-12 05:17:22.636 emailAuth[11936] <Notice> [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see url.com) 
2017-06-12 05:17:22.637 emailAuth[11936] <Notice> [Firebase/Analytics][I-ACS003007] Successfully created Firebase Analytics App Delegate Proxy automatically. To disable the proxy, set the flag FirebaseAppDelegateProxyEnabled to NO in the Info.plist 
2017-06-12 05:17:22.678 emailAuth[11936] <Warning> [Firebase/Analytics][I-ACS032003] iAd framework is not linked. Search Ad Attribution Reporter is disabled. 
2017-06-12 05:17:22.695 emailAuth[11936] <Notice> [Firebase/Analytics][I-ACS023012] Firebase Analytics enabled 
2017-06-12 05:17:23.992594+0300 emailAuth[11936:2101062] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /Users/mmuazekici/Library/Developer/CoreSimulator/Devices/4F8B6824-4D8D-4FB4-9E06-BFB49F220240/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles 
2017-06-12 05:17:23.992826+0300 emailAuth[11936:2101062] [MC] Reading from private effective user settings. 
+0

を次のコードを追加します。やった。 –

答えて

0

手順

従い

Podfile: - プロジェクト内

pod 'Firebase/Core' 
pod 'Firebase/Storage' 
pod 'Firebase/Database' 
pod 'Firebase/Auth' 

ドラッグ&ドロップグーグル-plistの

GoogleService-Info.plist 

は、あなたがコードを追加する必要があり、私たちは何を知っているAppDelegate

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 
     FIRApp.configure() 
} 

ステップ-1

import Firebase 
import FirebaseAuth 

ステップ-2 ログインアクション

guard let email = txtFldUserID.text?.lowercased(), let password = txtFldPassword.text else { return } 
     FIRAuth.auth()?.signIn(withEmail: email, password: password, completion: { (user: FIRUser?, error) in 

      if let error = error as NSError?{ 

       let errorName = (error.userInfo as NSDictionary).value(forKey: "error_name") as! String 
       proxy.shared.displayFirbaseError(errName: errorName) 
       return 
      }else{ 
       proxy.shared.displayStatusCodeAlert("You are login successfully") 
    } 
+0

私はFirebaseの新しいバージョンを使用していると思います。なぜなら、 "FIRApp.configure()"を試してみると、 "FIRAppがFirebaseAppに名前が変更されました"ということです。いくつかの小さな違いがありますが、私はドキュメンテーションに従っており、鉱山は正しいはずです。 –

関連する問題