Install .mobileconfig Programmatically

。_饼干妹妹 提交于 2019-12-06 06:46:51

问题


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. 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.

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. Once I navigate to this webpage, my server will send the mobile device a .mobileconfig file in order to install a configuration profile. I haven't been able to find a clear answer on how to handle this .mobileconfig file once it is sent by the server. I have read in a few different places that UIWebView cannot handle the .mobileconfig file once it is sent. 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? i.e. 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.


回答1:


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:

Switch to safari, let the user install the config and send him back to your app. Just register to a custom URL Scheme like "yourapp://" and add a link to this URL in the HTML.



来源:https://stackoverflow.com/questions/12082184/install-mobileconfig-programmatically

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