Swift Firebase Must be a non-empty string and not contain '.' '#' '$' '[' or ']'

前端 未结 1 784
刺人心
刺人心 2020-12-07 06:22

This is a follow up to my previous question. I am trying to see if an email has already been used.

I am using the line

if snapshot.hasChild(email) {         


        
相关标签:
1条回答
  • 2020-12-07 06:53

    Firebase keys cannot contain a . (dot) character. If you want to store an email address in a key, you'll have to encode it. The common way to do that is to replace the . with a , (comma), which conveniently is not allowed in email addresses. So test1@test.com would be encoded as test1@test,com.

    I don't think you're actually storing the email address as a key, but I'll follow up for that on your previous question.

    0 讨论(0)
提交回复
热议问题