简体   繁体   English

从“设备锁定”屏幕打开应用程序时如何停止LocalNotificationSound

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

In my application iam using UILocalNotifications, and for that notification iam setting 30 sec audio file. 在我的应用程序中,iam使用UILocalNotifications,并为该通知iam设置30秒的音频文件。

  • 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. 在此扫描中,通知声音持续播放长达30秒。

I need to stop the notification sound when app is open. 应用打开时,我需要停止通知声音。 Please help me for implementing this functionality. 请帮助我实现此功能。 Thanks in advance. 提前致谢。

You can't, since the sound is played by iOS and not your app. 您不能,因为声音是由iOS而不是您的应用播放的。 Thus you have no control over it. 因此,您无法控制它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM