Ios 如何检查用户之前是否已注册(Firebase Auth)?

Ios 如何检查用户之前是否已注册(Firebase Auth)?,ios,swift,firebase,firebase-authentication,Ios,Swift,Firebase,Firebase Authentication,如何检查用户以前是否使用其电话号码在客户端注册过(Firebase Auth)? 我使用的是Swift 5和Xcode 10,但在客户端SDK中无法做到这一点。在应用程序中查找电话号码的开放API可能会涉及隐私问题 但是,您可以通过以下方式建立自己的支票: admin.auth().getUserByPhoneNumber(phoneNumber) .then(function(userRecord) { // User with provided phone number is a

如何检查用户以前是否使用其电话号码在客户端注册过(Firebase Auth)?
我使用的是Swift 5和Xcode 10,但在客户端SDK中无法做到这一点。在应用程序中查找电话号码的开放API可能会涉及隐私问题

但是,您可以通过以下方式建立自己的支票:

admin.auth().getUserByPhoneNumber(phoneNumber)
  .then(function(userRecord) {
    // User with provided phone number is already registered.
  })
  .catch(function(error) {
    // if error.code 'auth/user-not-found' thrown,
    // then the user does not exist.
    console.log('Error fetching user data:', error);
  });