I'm making a sample note-taking app with Firebase where users can login and create simple text notes. My Firebase data structure is as follows:
"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
},
}
}
}
It works fine with user logging in. However, I want to add "Continue without login" functionality. I generated unique User ID using push() to use instead of auth UID and stored in sharedprefs. However, how can I migrate all those notes to the user's UserID(UID) when he decides to sign in later?