简体   繁体   English

在应用程序中禁用iphone主页按钮,可以吗?

[英]Disable iphone home button in app, is it possible?

I want to develop a screensaver-like app where the only way of getting back to the springboard is entering a code. 我想开发一个类似屏幕保护程序的应用程序,在该应用程序中,回到跳板的唯一方法是输入代码。 Therefore I would need the Home Button action to be ignored, that is that when the user presses the button nothing happens..or something custom...instead of going back to the springboard and terminating the app. 因此,我需要忽略“主页按钮”操作,即当用户按下按钮时,什么也没有发生……或自定义操作……而不是回到跳板并终止应用程序。 Is this possible? 这可能吗? does anybody know if apple will approve/reject this kind of app? 有谁知道苹果是否会批准/拒绝这种应用程序?

The answer to your question is, yes. 您的问题的答案是,是的。

The answer to the question you meant to ask--can I ship an app through the iPhone store that has the home button disabled--is no. 您要问的问题的答案是“否”。我可以通过禁用了“主页”按钮的iPhone商店运送应用吗?

If you are only publishing your app to jailbroken phones you can do it, but it will piss everyone off. 如果您仅将应用程序发布到越狱的手机上,则可以这样做,但它会让所有人大为恼火。

Edit 7 years later: This is actually extremely possible now--there is a standard feature in the iPhone called "Guided Access". 7年后进行编辑:现在实际上已经非常有可能-iPhone中有一个标准功能,称为“引导访问”。 It's hidden under that "Accessibility" Link (With some other fairly cool stuff like flashing the LED whenever you get a call and allowing a Bluetooth keyboard to tab between controls) 它隐藏在“可访问性”链接的下面(还有其他一些很酷的东西,例如每当您接到电话时都会闪烁LED并允许蓝牙键盘在控件之间切换)

It's called "Guided Access". 它称为“引导访问”。 You set a passcode, launch the app then triple-click the home button to start guided access. 您设置密码,启动应用程序,然后三键单击主页按钮以开始引导式访问。

It disables exit and allows you to designate regions of the screen you can't touch. 它禁用退出功能,并允许您指定无法触摸的屏幕区域。 You can also set a time limit (For kids playing which seems to be the reason a lot of people look up this question). 您还可以设置时间限制(对于孩子们玩耍,这似乎是很多人关注此问题的原因)。

Tempted to edit the "Accepted answer" and throw this info in there, but that seems rude so I'll just hope people find this answer. 试图编辑“接受的答案”并将此信息扔在那里,但这似乎很不礼貌,所以我只希望人们能找到这个答案。

Annoyingly you also seem to be unable to shut off the phone--I suppose this is perfect for people who want their kids to play a game, but might not hit the original asker's problem of restricting access to a single app (I mean it WILL do that but it'll also prevent it from doing ANYTHING else). 令人烦恼的是,您似乎也无法关闭手机-我想这对于希望孩子玩游戏但可能不会遇到最初限制者限制访问单个应用程序的问题的人来说非常完美(我想这会这样做,但也会阻止它执行其他操作)。

Not with public APIS (and hopefully, not with private ones). 不支持公共APIS(希望不支持私有API)。 Even if you manage it somehow, Apple will reject it for breaking UI guidelines. 即使您以某种方式进行管理,Apple也会因为违反UI准则而拒绝它。 Moreover, even if they didn't, people could always use the iPhone's "Force Quit" equivalent to hard terminate your app. 而且,即使他们没有这么做,人们也总是可以使用iPhone的“强制退出”来强制终止您的应用程序。

You can do it like this Install the following mobileconfig file This will disable the home button once you launch the app 您可以像这样进行操作安装以下mobileconfig文件,这将在启动应用程序后禁用主页按钮

Download 下载

Found the link Here 这里找到链接

Apple不会批准这种类型的应用程序,他们明确表示您需要对跳板做出适当的响应,以告知应用程序在出现电话呼叫或内存警告时均终止。

This is not possible with the current SDK, nor do I suspect it will ever be. 当前的SDK无法做到这一点,我也不可能做到这一点。

You might be able to get this behaviour via jailbreaking, but you won't be able to sell your app through iTunes, nor will Apple ever approve such an application. 您可能可以通过越狱获得此行为,但是您将无法通过iTunes出售您的应用程序,Apple也不会批准这种应用程序。

Apple won't allow it. 苹果不允许。
What if something emergency happens and you wan to dial an emergency phone number. 如果发生紧急情况并且您要拨打紧急电话号码该怎么办。 You are putting the user at risk. 您使用户处于危险之中。 The trade-off isn't worth it. 权衡是不值得的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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