首页 > 解决方案 > 为什么我的“let =”值与我的快照值不同?

问题描述

我正在尝试为 fcm 推送通知实现 id/token。我将 id/token 存储在我的 firebase 数据库中。我在获取常量值以匹配快照值时遇到问题。这是代码和图片。[![在此处输入图片描述][1]][1]

在此处输入图像描述

let database = self.ref.child("\(safetyEmail)").child("uid")
               
let otherUseruid = database.observe(.value) { snapshot in

    guard let ouid = snapshot.value as? String else {
        return
    }
    
    print("this is the ouid: \(ouid)")

}

print("this is the otherUseriD: \(otherUseruid)")

什么是 otherUseruid 与 ouid 不同的值?

标签: iosswiftfirebasefirebase-realtime-database

解决方案


推荐阅读