Firebase 函数获取用户 phone 号

Firebase functions get the user phone number

我正在使用 Firebase 函数在 onCreate 中保存用户信息,使用身份验证触发器。如果他使用这种方法进行身份验证,是否有办法获取用户 phone 号码?

如图Functions Github repo

Phone Auth now triggers Cloud Functions, as intended. Here's an example of the UserRecord object (in event.data) that you might receive:

{
  "metadata": {
    "createdAt": "2017-06-01T23:01:23.000Z",
    "lastSignedInAt": "2017-06-01T23:01:23.000Z"
  },
  "phoneNumber": "+1555123456",
  "providerData": [
    {
      "providerId": "phone",
      "uid": "+1555123456"
    }
  ],
  "uid": "C6simWCCNlO3Mdyq9PYyY1O8qPJ3"
}

然后可以从 UserRecord.phoneNumber

获得 phone 号码