iOS 设备静音时是否可以播放本地通知声音
我正在开发闹钟,当收到本地通知时需要唤醒。但是当设备静音时我听不到任何声音,我之所以这么问是因为我看到有两个应用程序实现了该功能,即(无线电警报)。 谢谢,托默。
I'm developing alarm clock which needs to wake up when receiving local notification. but when the device on mute I cannot hear anything, I'm asking because I saw 2 apps which implemented that i.e (radio alarm).
thanks, tomer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
查看
AVAudioSession
的setCategory
函数——它应该可以满足您的需要。以下是有关类别信息的链接:开发人员.apple.com - 音频会话类别
Check out
AVAudioSession
'ssetCategory
function -- it should do the trick for you.Here's a link for info on the categories: developer.apple.com - Audio Session Categories
我几乎可以肯定,RadioAlarm 能够在静音时播放,因为它会在后台运行。对于正常的本地通知(即即使在应用程序完成后也会触发的通知),我还没有找到一种方法来克服静音开关或铃声音量。
RadioAlarm, I'm almost certain, is able to play when muted because it keeps itself running in the background. For a NORMAL local notification (i.e. one that fires even after the app finishes), I have not found a way to overcome the mute switch or the ringer volume.