gpt4 book ai didi

ios - 在后台检测应用程序是否已启动

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:04:24 25 4
gpt4 key购买 nike

我想保存应用程序启动的时间,并在检测到启动事件时将其保存到数据库中。每次启动应用程序时,我都想保存在数据库中。

我尝试在 android 中使用该服务执行此操作,这在 iOS 中可行吗?

我在 https://gist.github.com/hpique/7554209 中找到了公共(public)通知列表它不在那里。

我希望有人能帮助我。谢谢。

最佳答案

最佳选择:

您只想在应用程序启动时节省时间。所以你可以使用 didFinishLaunchingWithOptions 方法。

在 iOS 上,您不能在后台拥有这种功能。像 android 你不能运行该服务。一切都在沙盒中。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// App Launched, save the time here
// Put your Code here

return YES;
}

关于ios - 在后台检测应用程序是否已启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25199589/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com