gpt4 book ai didi

ios - 从应用程序访问 iPhone 闹钟?

转载 作者:搜寻专家 更新时间:2023-10-31 23:03:41 37 4
gpt4 key购买 nike

有没有办法从我的应用程序访问和更新 iPhone 中的 native 闹钟设置?我需要一个根据一年中的时间变化的滑动闹钟,我想为此使用原生 iPhone 闹钟。这在 iOS SDK 中是否可行,例如,当您的应用需要访问相机或照片时,可能会要求用户访问警报?

最佳答案

不幸的是,我认为没有用于访问时钟应用程序和设置的公共(public) API。我认为这样做的原因是 Apple 希望将 Clock 独特的后台行为限制在其 native 应用程序中。

另一种方法是使用 UILocalNotifications 来触发警报。

来自Apple Docs ,

Local notifications are ideally suited for apps with time-based behaviors, such as calendar and to-do list apps. Apps that run in the background for the limited period allowed by iOS might also find local notifications useful.

关于ios - 从应用程序访问 iPhone 闹钟?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29860001/

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