简体   繁体   English

首次启动时的iOS用户信息

[英]iOS user info at first launch

How do I collect user info the first time my app launches? 如何在我的应用首次启动时收集用户信息?

I want to make sure they agree to terms of use - if they disagree, how do I keep them from using app features? 我想确保他们同意使用条款 - 如果他们不同意,我如何阻止他们使用应用功能?

As far as I understand your question; 据我了解你的问题; simplest possible way; 最简单的方法; just check NSUserDefaults if the information you require is saved there. 如果您需要的信息保存在那里,请检查NSUserDefaults。

If it is, great, just start the app. 如果是,那很好,只需启动应用程序。

If it's not, ask the user to enter the information and accept the agreement. 如果不是,请要求用户输入信息并接受协议。 When that's done, save it in NSUserDefaults so the next time it won't ask, and start the app. 完成后,将其保存在NSUserDefaults中,以便下次不会询问,并启动应用程序。

If the user never agrees, the info is not in NSUserDefaults, so he won't be able to get past the accept screen, it'll ask him to accept every time. 如果用户从不同意,该信息不在NSUserDefaults中,因此他将无法通过接受屏幕,它会让他每次都接受。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM