【问题标题】:How to check an email address is whether Apple's private email or an actual email如何检查电子邮件地址是 Apple 的私人电子邮件还是实际电子邮件
【发布时间】:2023-03-10 07:14:01
【问题描述】:

我正在开发一个 iOS Swift 项目,在该项目中我实现了 Sign in with Apple。但是当用户尝试使用 Apples 登录时,它会要求共享电子邮件或隐藏电子邮件。如果是共享则意味着它将返回实际的电子邮件,如果是隐藏则意味着它会返回一些私人电子邮件,例如

<unique-alphanumeric-string>@privaterelay.appleid.com

但是有什么方法可以检查返回的电子邮件是实际用户的电子邮件还是苹果的私人电子邮件?

【问题讨论】:

  • 您可以查看域名:@privaterelay.appleid.com

标签: ios swift apple-sign-in


【解决方案1】:

举例:

let email = "7dhu73da@privaterelay.appleid.com"
let isApplePrivateEmailAddress = email.hasSuffix("@privaterelay.appleid.com")

【讨论】:

    猜你喜欢
    • 2017-07-23
    • 1970-01-01
    • 2017-07-21
    • 2022-06-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-21
    相关资源
    最近更新 更多