小编Ler*_* Ws的帖子

尝试将数据附加到子值时,应用程序崩溃

我按照firebase中的说明进行操作,但即使确保文本条目为String类型,我仍然会崩溃.

这是错误:

由于未捕获的异常"InvalidPathValidation"而终止应用程序,原因:'(child :)必须是非空字符串且不包含'.' '#''$''['或']''

这是代码:

import UIKit
import Firebase
import FirebaseDatabase
import FirebaseAuth

class BioEditViewController: UIViewController {

    @IBOutlet weak var bioTextView: UITextView!
    let databaseRef = FIRDatabase.database().reference()


    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func viewWillAppear(animated: Bool) {
        let userID = FIRAuth.auth()?.currentUser?.uid
        databaseRef.child("users").child(userID!).observeSingleEventOfType(.Value, withBlock: { (snapshot) in
            // Get user level
            let userBio = snapshot.value!["userBio"] as! String
            self.bioTextView.text = userBio

        })
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning() …
Run Code Online (Sandbox Code Playgroud)

firebase swift

3
推荐指数
1
解决办法
4695
查看次数

在转换为swift 3语法后,应用无法通过Facebook和Firebase进行身份验证

我已经清理了我的项目以解决所有错误.应用程序似乎启动,登录页面似乎工作,但当我尝试登录到Facebook时,会发生以下情况:

TCP_CONNECTION_EVENT_TLS_HANDSHAKE_COMPLETE in response to state ready and error (null)  
2016-09-15 12:36:50.254067 2[3083:89230] [] tcp_connection_event_notify 12 event: TCP_CONNECTION_EVENT_TLS_HANDSHAKE_COMPLETE, reason: nw_connection event, should deliver: true  
2016-09-15 12:36:50.254511 2[3083:89230] [] tcp_connection_get_statistics DNS: 3ms/7ms since start, TCP: 61ms/76ms since start, TLS: 99ms/172ms since start  
2016-09-15 12:36:50.492341 2[3083:89140] [] tcp_connection_cancel 12  
2016-09-15 12:36:50.493012 2[3083:88773] [] nw_socket_handle_socket_event Event mask: 0x4  
2016-09-15 12:36:50.493506 2[3083:88773] [] nw_socket_handle_socket_event Socket received WRITE_CLOSE event  
2016-09-15 12:36:50.494087 2[3083:88773] [] nw_endpoint_handler_cancel [12 graph.facebook.com:443 ready resolver (satisfied)]  
2016-09-15 12:36:50.494691 2[3083:88773] [] nw_endpoint_handler_cancel [12.1 …
Run Code Online (Sandbox Code Playgroud)

facebook ios firebase firebase-authentication swift3

1
推荐指数
1
解决办法
2634
查看次数