12

My org is creating an app, that will have certain wifi hotspots listed in a mobile config file, so that the user does not have to write the password for these wifi when he is in range. I know this can be done using .mobileconfig file. But I have serious doubts.

Here are few questions regarding the app:

  1. Can .mobileconfig file be created programatically. I cannot find a link to how to cretae this programatically (not using iPCU).

  2. Will Apple allow an app that creates .mobileconfig file and asks the user to download it and install it, so as to change the wifi settings?

  3. Is making the user download this .mobileconfig file only possible via Safari or Mail? Is there any way that this file be opened directly from the app to the settings screen?

Thanks in advance. :)

Nikita P
  • 4,226
  • 5
  • 31
  • 55
  • there are some similar questions on SO regarding the installation of a `.mobileconfig`. see e.g. http://stackoverflow.com/questions/2338035/installing-a-configuration-profile-on-iphone-programmatically –  May 29 '13 at 07:43

1 Answers1

22

1) Yes it can. It can be created as an XML file. In fact, you can open and edit an unsigned .mobileconfig file in a text editor and edit the fields. Keep in mind that if it's signed then any edits to the file will require you to re-sign it.

2) Apple will allow an app that downloads and installs a .mobileconfig via Safari, I've seen one on the App Store that does this.

3) Safari + Mail are the only ways to open them(on iOS).

SG1
  • 545
  • 3
  • 5
  • Thanks for ur reply. some more info needed: 1. do u have any link to how to make this xml file? tags that are already defined/necessary etc. 2. can you tell me the app name :) – Nikita P May 30 '13 at 08:36
  • 1
    Well, since an unsigned .mobileconfig has the same structure as a .plist file, you should be able to create it programmatically the same way. See: http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/PropertyLists/CreatePropListProgram/CreatePropListProgram.html – SG1 May 30 '13 at 18:44
  • 2
    Many VPN apps use the mobileconfig files. An example is the app Onavo which installs a proxy. See: https://itunes.apple.com/us/app/onavo/id577491499?mt=8&ls=1 – SG1 May 30 '13 at 18:49
  • Does anyone know how to do this today? I've tried opening them on gmail but it just lets me preview the source code – Capn Jack Sep 07 '17 at 12:48
  • 1
    Mail is not required as long as you can host the `.mobileconfig` on a public URL somewhere. You can just open that URL in Safari and it will work. – Christophe Marois Mar 02 '18 at 17:33
  • Airdrop is another option. Just send the xx.mobileconfig file from a mac / iPhone by AirDrop, then the receiving iPhone will advise the user to open Settings App to install the downloaded file. – DawnSong Jul 01 '20 at 03:07