Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I send a Local Notification with no sound?

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.

Thanks!!

like image 366
SirRupertIII Avatar asked Jul 25 '13 08:07

SirRupertIII


People also ask

Can you send local notifications while app is in background?

Notifications could be created at any moment (on Foreground, Background or even when the application is terminated/killed).

How do I get push notifications to make sound?

Go to Settings > Apps & notifications > Notifications. Scroll down and tap Advanced > Default notification sound. Tap My Sounds.


1 Answers

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.

like image 76
Nishant Tyagi Avatar answered Oct 14 '22 11:10

Nishant Tyagi