iOS检测系统音量级别更改.私有API与否? AVSystemController_SystemVolumeDidChangeNotification [英] iOS Detect system volume level change. private API or not? AVSystemController_SystemVolumeDidChangeNotification

查看:772
本文介绍了iOS检测系统音量级别更改.私有API与否? AVSystemController_SystemVolumeDidChangeNotification的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在App Store审核过程中,是否可以考虑使用AVSystemController_SystemVolumeDidChangeNotification NSNotification监听

Can listening to AVSystemController_SystemVolumeDidChangeNotification NSNotification be considered (during the App Store review process) as using private API?

在我的应用程序中,我需要显示和更新当前的音量级别.按下硬件音量按钮后,并在MPVolumeView滑块中更改音量后,应更新音量指示器.

In my application I need to display and update the current volume level. Volume indicator should be updated after pressing hardware volume buttons and after volume change in MPVolumeView slider.

我已经搜索了如何获得通知或硬件按键按下事件的解决方案,并且找到了许多解决方案.

I've searched solution how to get notification or event of hardware volume button press and had found a number of solutions.

例如, iPhone检测音量键按下.

如何获取音频音量级别和iOS上的音量更改通知?

我喜欢听NSNotificationCenter的解决方案,而且似乎最简单,最清晰的解决方案是听AVSystemController_SystemVolumeDidChangeNotification(而且效果很好)

I like the solution with listening to NSNotificationCenter and it seems that the most simplest and clear solution is listening to AVSystemController_SystemVolumeDidChangeNotification (And it works fine)

但是我肯定要知道一件事.

But there are one important thing that I want to know for sure.

此通知名称未出现在任何Apple官方文档中,并且正在讨论是否将此通知用法视为使用私有API".

This notification name is not appearing in any official Apple documentation, and there are discussions about if this notification usage will be considered as "Using the private API" or not.

据我了解,使用私有API与调用私有方法相关联.这就是为什么不能将此通知密钥视为私有API的用法(因为实际上我们将通知名称用作NSString).

As I understand, using the private API is connected with calling private methods. Thats why using this notification key can not be considered as private API usage (because actually we are using notification name as NSString).

也许有人肯定知道这一点,或者有使用AVSystemController_SystemVolumeDidChangeNotification的经验,并且应用程序已提交/被拒绝?

Maybe somebody knows this for sure, or have experience with usage of the AVSystemController_SystemVolumeDidChangeNotification and app was submitted/rejected?

非常感谢您提供任何信息!

Many thanks for any information!

推荐答案

我知道注释中已经提到了使用KVO的替代方法.评论中还讨论了此方法的局限性.但是,最初的问题是关于使用NSNotificationCenter和AVSystemController_SystemVolumeDidChangeNotification的经验.我已经在我的应用程序中使用了此方法,但并没有被拒绝.它可以在AppStore上获得.

I know an alternative method using KVO has been mentioned in the comments. The limitations of this method are also discussed in the comments. The original question though was about experience of using the NSNotificationCenter and AVSystemController_SystemVolumeDidChangeNotification. I have used this method in my app and it didn't get rejected. It is available on the AppStore.

这篇关于iOS检测系统音量级别更改.私有API与否? AVSystemController_SystemVolumeDidChangeNotification的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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