How to stop the LocalNotificationSound when application is opening from Device Locking screen

我只是一个虾纸丫 提交于 2019-12-11 20:58:00

问题


In my application iam using UILocalNotifications, and for that notification iam setting 30 sec audio file.

  • Notification fired if device is UnLock state and my app is in background mode then if i click on notification bar then my app is open and notification sound is stopping. This scanario is fine.

  • Notification fired if device is locke state and my app is in background mode then if i drag the notification then my app is open and notification sound is not stopping. In this scanario notification sound is continuesly playing upto 30 sec.

I need to stop the notification sound when app is open. Please help me for implementing this functionality. Thanks in advance.


回答1:


You can't, since the sound is played by iOS and not your app. Thus you have no control over it.



来源:https://stackoverflow.com/questions/23776686/how-to-stop-the-localnotificationsound-when-application-is-opening-from-device-l

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!