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

查看:134
本文介绍了停止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.

推荐答案

我是pretty肯定这是苹果的结束一个bug,看的devforums.apple.com/message/888091 (感谢Gui13)。文件重复的错误报告,得到苹果重视它,因为了苹果是如何分配优先级的错误。在此期间,下面的工作,但也将清除所有在通知中心,这当然是一个粗制滥造的解决办法,但在我的情况的通知是值得的,直到这被固定的:

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天全站免登陆