我正在使用Firebase制作一个示例笔记应用程序,用户可以登录并创建简单的文本笔记。 我的Firebase数据结构如下:
"Project-dir":{
"Notes":{
"UserID":{
"NoteKey":{
"title":"This is note title",
"content":"This is the note content",
"unixTime":123456789
},
"NoteKey":{
"title":"This is note title",
"content":"This is the note content",
"unixTime":123456789
},
}
}
}
在用户登录时,它可以正常工作。 然而,我希望添加“不登录继续”的功能。我使用push()生成唯一的用户ID,以代替auth UID并存储在sharedprefs中。 然而,当用户决定稍后登录时,如何将所有这些笔记迁移到用户的用户ID(UID)中?