我可以发送没有声音的本地通知吗?

编程入门 行业动态 更新时间:2024-10-26 06:36:09
本文介绍了我可以发送没有声音的本地通知吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想要一些本地通知,没有显示,没有声音,但只有振动。只需将 alertBody 设置为 @,我就可以不进行显示,但我怎么能发送不声音?我想如果我没有从你们那里得到更好的方法,我将能够发出一个空的声音,将它添加到我的项目中,然后将soundName设置为该声音。但有没有任何默认的方法来做到这一点?

I want to have a few local notifications with no display and no sound, but only a vibration. I can get it to do no display, by simply setting alertBody to @"", but how can I send no sound? I am thinking if I don't get a better way from you guys, that I will be able to just make a sound that is empty, add it to my project, then set soundName to that sound. But is there any sort of default way to do this?

如果我添加一个虚假的声音名称,它仍然会播放默认的通知声音。

If I add a phony sound name it still plays the default notification sound.

谢谢!

推荐答案

不,你不能禁用声音,因为UILocalNotification没有为此提供任何选项。所以更好的选择是你在问题中告诉我使用一个空的声音文件。

No you can not disable sound because UILocalNotification does not provide any option for this. So better option is as you told in your question to use a empty sound file.

更多推荐

我可以发送没有声音的本地通知吗?

本文发布于:2023-11-27 01:56:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1636094.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:声音   通知

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!