问题
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