以编程方式使App中的iPhone静音? [英] Programmatically Silence iPhone from App?

查看:91
本文介绍了以编程方式使App中的iPhone静音?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须创建一个应用程序,在该应用程序中,iPhone在按钮按下事件后将保持静音.

I have to create an app in which the iPhone goes silent upon a button press event.

您如何以编程方式执行此操作?

How can you do this programatically?

推荐答案

在官方的iOS SDK中,没有任何东西可以做到这一点.假设有人错过了重要电话,因为某个应用程序更改了设置并在用户不知情的情况下使电话静音.我不想肯定下载该应用程序.请参阅与此相关的问题也是.

There is nothing in official iOS SDK to do this. Imagine someone miss an important call because an app changed settings and made phone silent without user's knowledge. I don't want to download that application for sure. See this related question too.

摘自Apple文档

人们(而不是应用程序)应该启动和控制操作. 尽管应用程序可以建议采取行动或发出警告 危险的后果,这通常是应用程序的错误 决策远离用户.最好的应用找到正确的 在帮助人们提供所需功能的同时保持平衡 他们避免危险的结果.

People, not applications, should initiate and control actions. Although an application can suggest a course of action or warn about dangerous consequences, it’s usually a mistake for the app to take decision-making away from the user. The best apps find the correct balance between giving people the capabilities they need while helping them avoid dangerous outcomes.

如果我没记错的话,让手机静音是这种动作之一.

If I am not mistaken, making phone silent is one these kind of action.

阅读苹果的声音部分转到Apple开发人员论坛(您必须登录),然后查看线程.回答那里的那个人是一个苹果公司的雇员.

Go to apple developer forum (You must have a login), and see this thread. The guy who answers there is an apple employee.

这篇关于以编程方式使App中的iPhone静音?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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