简体   繁体   中英

Is it possible to disable volume buttons in iOS apps?

I am developing a Game and I would like to disable the volume buttons when I am playing (because the user has to use the accelerometer and could accidentally press it). Is it possible at all?

Edit:

This Q&A explains how to set up a volume listener.

This Q&A explains how to hide volume overlays.

Old answer: This has not been possible in the past, because the practice has been explicitly disallowed by the app store review guidelines which no longer apply:

Apps that alter the functions of standard switches, such as the Volume Up/Down and Ring/Silent switches, will be rejected

I've already asked myself to that to and theoretically it would work. Only if you want to publish your app in the AppStore is this prohibited according to this source from December 8th, 2021 at 12:51 pm .: Apple Developer Guidlines

Apps that alter or disable the functions of standard switches, such as the Volume Up/Down and Ring/Silent switches, or other native user interface elements or behaviors will be rejected. For example, apps should not block links out to other apps or other features that users would expect to work a certain way. Learn more about proper handling of links.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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