在Firebase 3 for iOS中更改用户的电子邮件/密码

Ale*_*ini 5 objective-c ios firebase

我正在寻找在今天的重大更新之后取代Firebase类中的'changeEmailForUser'和'changePasswordForUser'的新类和方法.我认为他们现在是FIRAuth的一部分,但我似乎找不到任何东西.有人能指出我正确的方向吗?

Tek*_*ock 8

文档有点令人困惑,但在"管理用户"部分的底部,在"iOS"下面的"身份验证",这是在这里

根据文档,更新用户的电子邮件地址:

FIRUser *user = [FIRAuth auth].currentUser;

[user updateEmail:@"user@example.com" completion:^(NSError *_Nullable error) {
  if (error) {
    // An error happened.
  } else {
    // Email updated.
  }
}];
Run Code Online (Sandbox Code Playgroud)

并为密码:

FIRUser *user = [FIRAuth auth].currentUser;
NSString *newPassword = [yourApp getRandomSecurePassword];

[user updatePassword:newPassword completion:^(NSError *_Nullable error) {
  if (error) {
    // An error happened.
  } else {
    // Password updated.
  }
}];
Run Code Online (Sandbox Code Playgroud)

有关密码重置电子邮件的其他重要信息都在上面给出的链接中.