问题描述
是否有任何方法可以使用户注销,但至少以匿名身份登录过 Firebase 用户 uuid ?也许可以通过 keychain 访问权限或Firebase userDefaults 来获取 uuid ?
Is there any way to get Firebase user uuid when user is logged out, but was logged in at least once as a anonymous?Maybe its possible to get uuid from keychain access or from Firebase userDefaults?
推荐答案
只有在当前具有 [FIRAuth auth] .currentUser
的情况下,您才能获取UID.不建议使用其他任何"hacky"方法来尝试检索此方法.
You can only get the UID if there is a current [FIRAuth auth].currentUser
. Any other 'hacky' method to try and retrieve this would not be recommended.
如果您想在他们注销后得到此消息,可以将其保存到 UserDefaults
或您自己的钥匙串中,并在他们登录时保存.
If you wanted to get this after they had logged out you could save this into UserDefaults
or the keychain yourself while they are logged in.
这篇关于如何获得Firebase用户uuid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!