ios - IOS 中的警报应用循环声音通知

标签 ios iphone apple-push-notifications uilocalnotification

我正在开发 IOS 中的警报应用程序。 当应用程序处于后台模式时我想在哪里发送通知。 声音通知类似于 ALARM。 也就是说,除非用户不执行任何交互,否则声音不会停止。

我们使用了通知,但它只会播放 30 秒。 即默认通知。 是否有任何其他选项可以通过声音(ALARM)通知用户。

提前致谢。

最佳答案

另一种解决方法是,将本地通知的 repeatInterval 属性设置为 NSMinuteCalendarUnit。

localnotification.repeatInterval = NSMinuteCalendarUnit;

一旦用户打开应用程序,使用

取消所有通知
[[UIApplication sharedApplication] cancelAllNotification];

或者,

Cancel a particular notification

关于ios - IOS 中的警报应用循环声音通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20063674/

相关文章:

ios - 如何将单元格宽度与框架宽度不同的 UICollectionviewCell 居中并启用分页

ios - Apple 拒绝了我的应用程序,因为它不包含允许用户从"file"应用程序中查看或选择项目的功能

iphone - 如何在 UITextfield 验证中避免特殊字符(@、#、& 等)

ios - 在团队中将应用程序提交到 iTunes connect

certificate - Apple Web 推送通知签名。什么是中级证书?

ios - 如何重置角标(Badge)应用程序图标数量?

ios - Xcode -dynamic not specified static library 报错

iphone - 使用平移的 UIImageView 移动不完全平滑

ios - 如何知道应用程序何时收到通知以及用户何时在 iOS 中单击通知

ios - 检查 NSURLrequest 是否有效?