在iPhone / iPad上禁用主页按钮 [英] Disabling home button on iPhone/iPad

查看:150
本文介绍了在iPhone / iPad上禁用主页按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我完全清楚这样做会让我的应用被Apple拒绝,这是一种糟糕的用户体验,等等。

First of all, I'm completely aware that doing this will get my app rejected by Apple, that it's a poor user experience, and so on.

我的问题很简单,有没有办法使用私有API来禁用主页按钮?目的是有效地将iPad置于自助服务终端模式。

My question is fairly simple, is there a way using private APIs to disable the home button? The aim is to effectively put an iPad into kiosk mode.

推荐答案

您无法禁用菜单按钮。这是由SpringBoard处理的,除非设备被越狱,否则你无法控制。

You can't disable the menu button. This is handled by the SpringBoard which you cannot control unless the device is jailbroken.

但是,您可以在用户退出后立即重新启动应用程序。假设您已注册 kioskRelaunch112084 URL方案:

You can relaunch the app immediately after the user quit, however. Assuming you have registered the kioskRelaunch112084 URL scheme:

-(void)applicationWillTerminate:(UIApplication *)application {
    [application openURL:[NSURL URLWithString:@"kioskRelaunch112084://"]];
}

请注意,用户仍然可以强制退出应用

Note that the user can still force-quit the app.

这篇关于在iPhone / iPad上禁用主页按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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