停止ios 7远程通知声音 [英] Stopping ios 7 remote notification sound

查看:27
本文介绍了停止ios 7远程通知声音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 iOS 7 中,当用户从锁屏滑动我的一个通知并被带到我的应用程序时,通知声音会继续播放(与 iOS 6 不同).当我的应用程序在 iOS 7 中启动时,有没有办法以编程方式停止该声音?

In iOS 7, when a user swipes one of my notifications from the lockscreen and is taken to my app, the notification sound keeps playing (unlike iOS 6). Is there any way to programmatically stop that sound when my app launches in iOS 7?

注意:有关粗制滥造的解决方法,请参阅已接受的答案.

NOTE: see the accepted answer for a shoddy workaround.

推荐答案

我很确定这是 Apple 端的错误,请参阅 devforums.apple.com/message/888091(感谢 Gui13).提交重复的错误报告以让 Apple 关注它,因为 即是 Apple 为 bug 分配优先级的方式.与此同时,以下内容将起作用,但也会清除通知中心中的所有通知,这当然是一种劣质的解决方法,但在我的情况下,在解决此问题之前值得:

I'm pretty sure this is a bug on Apple's end, see devforums.apple.com/message/888091 (thanks Gui13). File a duplicate bug report to get Apple to pay attention to it, as that is how Apple assigns priority to bugs. In the meantime, the following will work but will also clear all of your notifications in the notification center, which of course is a shoddy workaround, but in my case is worth it until this gets fixed:

[[UIApplication sharedApplication] setApplicationIconBadgeNumber: 1];    
[[UIApplication sharedApplication] setApplicationIconBadgeNumber: 0];

这篇关于停止ios 7远程通知声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆