在 firebase 管理用户文档中,我找不到任何方法来压缩或缩短电子邮件验证链接的长度。功能运行良好,但从用户角度来看,此链接看起来又长又奇怪。我在互联网上搜索过但没有找到任何解决方案。下面是我的代码,请编码:
var actionCodeSettings = ActionCodeSettings.init()
actionCodeSettings.handleCodeInApp = false
let user = FirebaseAuthenticationHandler.shared.currentFirebaseUser
actionCodeSettings.url = URL.init(string: String(format: "https://example.firebaseapp.com/?verifyemail=%@", user.email!))
actionCodeSettings.setIOSBundleID(Bundle.main.bundleIdentifier!)
user.sendEmailVerification(with: actionCodeSettings, completion: { (error) in
if error != nil {
print("\(error?.localizedDescription)")
} else {
print("Verfication email sent")
}
Run Code Online (Sandbox Code Playgroud)
这是我收到的链接的屏幕截图:
我在 firebase db 中创建了植物实体,我想为某些功能添加另一个“plantId”值。为此,我正在创建一个随机字符串 id 并将其传递给要保存在 db 中的植物对象,但我收到错误“文本的歧义使用”。我搜索了很多,但找不到任何解决方案。请在下面检查我的代码:
let plantId = NSUUID().uuidString
let plant = ["plantName": self.plantNameField.text, "plantType": self.plantTypeField.text, "plantLocation": self.plantLocationField.text,"userId": userID, "plantImageURL": plantImageURL, "plantId": plantId]
let childUpdates = ["/plants/\(key)": plant]
self.ref.updateChildValues(childUpdates)
Run Code Online (Sandbox Code Playgroud)
在上面的代码行号 2 中发生错误