Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是一个非常具体的问题。
我不太清楚为什么要在
didFinishLaunching
AppDelegate 的方法?
如果库是在 AppDelegate 之外配置的 - 让我们说在另一个 VC 中 - 跟踪不会工作吗?
建议在 didFinishLaunching 上初始化任何分析,因为您希望它在您调用它时随时准备就绪,就像一个记录器。
您可以从任何其他组件初始化它,但请确保首先执行它(因此当它未准备好时没有其他组件会调用它),并且只有一次,以避免出现错误状态。