简体   繁体   English

以编程方式安装.mobileconfig

[英]Install .mobileconfig Programmatically

I am writing an app in order to automate the process of connecting an Apple mobile device to a wifi network and downloading configuration profiles to the device. 我正在编写一个应用程序,以自动化将Apple移动设备连接到wifi网络并将配置文件下载到该设备的过程。 Since it is being automated (by something such as Native Driver), all of the functions need to be controlled by the app itself, not sent to another app such as Settings or Safari. 由于它是自动化的(例如通过本机驱动程序),因此所有功能都需要由应用本身控制,而不是发送到其他应用(例如“设置”或Safari)。

I am already using Apple80211 private framework to connect to a wifi network as well as UIWebView in place of a browser in order to navigate to a specific webpage. 我已经在使用Apple80211私有框架连接到wifi网络以及UIWebView来代替浏览器,以便导航到特定的网页。 Once I navigate to this webpage, my server will send the mobile device a .mobileconfig file in order to install a configuration profile. 导航到该网页后,我的服务器将向移动设备发送.mobileconfig文件,以安装配置文件。 I haven't been able to find a clear answer on how to handle this .mobileconfig file once it is sent by the server. 服务器发送此.mobileconfig文件后,我一直无法找到有关如何处理该文件的明确答案。 I have read in a few different places that UIWebView cannot handle the .mobileconfig file once it is sent. 我在几个不同的地方读过,UIWebView一旦发送后就无法处理.mobileconfig文件。 What would be the best way to handle this file when it is sent? 发送文件时处理该文件的最佳方法是什么?

Also, once it is sent, and granted that something can handle the file, is there a way to install the configuration profile programmatically without the need for user input? 而且,一旦发送了文件,并且可以处理某些文件,是否可以通过程序安装配置概要文件而无需用户输入? ie are there any public or private frameworks that I can implement in order to install the configuration profile "behind the scenes?" 即,是否可以实施任何公共或私有框架,以便在“幕后”安装配置文件?

This app is only ever going to be used for testing purposes, and will only ever live on a handful of devices. 该应用程序仅将用于测试目的,并且只能在少数设备上使用。 Thanks in advance, any help will be much appreciated. 在此先感谢您的帮助。

I tried a similar thing to do. 我尝试过类似的操作。

Unfortunately I didn't get it running with the UIWebView , but with switching to the Safari it worked: 不幸的是,我没有让它与UIWebView一起运行,但是通过切换到Safari就可以了:

Switch to safari, let the user install the config and send him back to your app. 切换到safari,让用户安装配置并将其发送回您的应用。 Just register to a custom URL Scheme like " yourapp:// " and add a link to this URL in the HTML . 只需注册一个自定义URL方案,例如“ yourapp:// ”,然后在HTML添加指向该URL的链接。

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

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