tvOS 唯一设备标识符

tvOS unique device identifier

我正在为 Apple TV 开发一个应用程序。它是一个客户端-服务器应用程序。注册后,用户将获得免费试用期。我的目标是避免用户只注册新帐户或重新安装应用程序并再次获得试用期的情况。我需要确定是否已经为每个具体设备激活了试用版。所以我想知道是否有合法或半合法的方式来识别每个设备?我将不胜感激任何想法!

您可以使用 identifierForVendor (documentation),但一旦卸载该应用程序,情况就会发生变化。

The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user deletes all of that vendor’s apps from the device and subsequently reinstalls one or more of them.

也许您可以将其与用户的电子邮件地址结合起来以防止创建新帐户。并非万无一失,但肯定会让用户更难绕过它。他们需要卸载该应用程序并使用不同的电子邮件地址来绕过您。

您可以在钥匙串中存储一些值(阅读更多相关信息 here) 并检查此值之前是否存储在钥匙串中。如果是,则表示用户之前安装了您的应用程序。