问题描述
有没有办法从我的应用程序访问和更新iPhone中的本机警报设置?我需要根据一年中的时间改变滑动警报,我想使用本机iPhone警报。这可能在iOS SDK中,也可能要求用户访问警报,例如当您的应用需要访问相机或照片时?
Is there a way to access and update the native alarm settings in the iPhone from my app? I need to have a sliding alarm that changes based on the time of year and I want to use the native iPhone alarm for that. Is this possible in the iOS SDK, maybe asking the user for access to the alarm like when your app needs access to the camera or photos for example?
推荐答案
不幸的是,我认为没有用于访问时钟应用和设置的公共API。我认为这样做的原因是Apple希望将Clock的独特背景行为限制在其原生应用程序中。
Unfortunately, I believe there is no public API for accessing the Clock app and settings. I think the reason for this is that Apple wants to restrict Clock's unique background behavior to its native app.
另一种方法是使用 UILocalNotifications
来启动闹钟。
An alternative would be to use UILocalNotifications
to set off the alarm.
来自,
这篇关于从应用程序访问iPhone闹钟?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!