有没有办法从我的应用程序访问和更新 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/