How to redirect to ios settings in Safari use javascript in ios9

倾然丶 夕夏残阳落幕 提交于 2020-01-04 04:33:49

问题


I want to know how to redirect to the iOS settings from Safari.

I've seen this on one website: I opened this website in Safari, and there is a button, and when I click this button, it can redirect to the iOS settings.

I think this can be realized by javascript.

Does anyone knows how to do this?

Note: I am using iOS9.


回答1:


Sorry,I have to answer my own question.I've found the solution.Just tested in ios9

This is my code:

<input type="button" onclick="redirect()" value="Redirect">
<script>
    var redirect = function() {
        window.location.href = "prefs:root=Settings";
    }
</script>

When I open this page in Safari and click the button,it can redirect to the Settings

If I want to redirect to Settings->General,it should be:

window.location.href = "prefs:root=General";

If I want to redirect to the Settings->General->Profiles,then should be:

window.location.href = "prefs:root=General&path=ManagedConfigurationList";

And I found the Preference list http://iphonedevwiki.net/index.php/Preferences.app




回答2:


I've seen a similar question like this and here is the answer. The only thing you have to change and figure out is the link to the application.

The SO question



来源:https://stackoverflow.com/questions/33685561/how-to-redirect-to-ios-settings-in-safari-use-javascript-in-ios9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!