更新时间:2023-01-06 09:00:46
你可以在一个用户处理这个问题两种不同的方式。
You can handle this problem in a two different way.
方法1:在KeyChain中存储标识
如果用户重置设备,您将丢失此钥匙串数据。
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