Firebase:从Firebase ID获取用户信息

时间:2016-08-20 21:28:00

标签: node.js swift firebase firebase-realtime-database firebase-authentication

我目前正在编写一个使用推送通知的Swift APP。 适用于swift的Firebase API仅允许您接收它们。 为了发送通知,您需要实现“firebase服务器包”并在您自己的NodeJS服务器上运行它。

我的NodeJS服务器在myserver / statistics /上有一个监听器。请参阅下面的“代码”以查看结构。 每当有一个新的ChildAdded(因此一个RandomIDX是一个新的统计输入)时,我会在DataSnapshot中获取路径。

Snapshot.key返回“FirebaseUserX”。

我的问题是如何将Firebase ID转换为其名称? 在新的firebase版本中,用户不再位于“数据库”中,而是“Auth”...(如何继续?) 是否有专用功能从其ID访问用户?我是否需要复制用户群?

statistics {
   *FirebaseUserID1* { // the stats of a specific user 1
      *RandomID1* {
         infoA:"hello",
         infoB:"world"
      }
      *RandomID2* {
         infoA:"hello",
         infoB:"world"
      }
   }
   *FirebaseUserID2* { // the stats of a specific user
      *RandomID3* {
         infoA:"hello",
         infoB:"world"
      }
      *RandomID4* {
         infoA:"hello",
         infoB:"world"
      }
   }
}

非常感谢,

马丁

0 个答案:

没有答案
相关问题