且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

即使在用户重新安装后,也可以限制iOS App

更新时间:2023-01-06 09:00:46

你可以在一个用户处理这个问题两种不同的方式。

You can handle this problem in a two different way.

方法1:在KeyChain中存储标识


  1. 如果用户已经安装了
    ,首先检查钥匙串中的值此设备上的应用程序与否。

  2. 如果是第一次安装,则提供免费硬币并将用户ID /标记存储在钥匙串中以识别将来的安装。

  1. First check the value from keychain if the user already installed the app on this device or not.
  2. If it is first time install then provide the free coins and store the user id/flag in the keychain to identify future install.




如果用户重置设备,您将丢失此钥匙串数据。

You will lose this keychain data, if user reset their device.

重置设备后,您将再次提供硬币,因为您的标记/标识符不会出现在钥匙串中。

After reset the device you will provide the coins again because your flag/identifier will not be there in the keychain.

如果你想避免这种情况,你必须采用第二种方法。

If you want avoid this situation then you have to go with the second approach.

接近2:在服务器上存储标识符

而不是将详细信息存储在设备密钥链中。您必须将其保存在您的服务器上。应用程序首次启动时,您必须检查您的服务器以提供详细信息。

Instead of storing the details on the device keychain. You have to save it on your server. App first launch you have to check with your server to provide the details.


这种方法即使用户重置设备也能正常工作

This approach always works even user reset their device