http://norbertlindenberg.com/2015/06/installing-fonts-on-ios/
The documentation for configuration profiles lists five ways to install them, of which the most practical ones are through email or a web server.
To install a configuration profile from email, for example for testing, simply email it to an account that you can access from the test device. If you tap on the profile icon in the email received on the device, Mail switches to Settings, which offers to install the profile. After the installation is done (or cancelled), control returns to Mail.
To make a configuration profile available for installation from a web server, store it on the web server and make sure that the extension is .mobileconfig. The content type for configuration profiles is application/x-apple-aspen-config, but Safari doesn’t seem to care whether the server reports that correctly as long as the extension is there. If you point Safari to a URL with extension .mobileconfig and reasonable content, it switches to Settings, which offers to install the profile. After the installation is done (or cancelled), control returns to Safari.
Installing configuration profiles from within apps
If you want to enable installation of configuration profiles from within an app without depending on an external web server, or if you don’t want to make the configuration profile available on a web server at all, then things get a little difficult. There’s no API that enables installation of configuration profiles from within apps. A basic solution that developers have come up with involves multiple steps:
Set up a web server within the app.
Configure the server to respond to a request from Safari with the configuration profile, using a Content-Type header with value application/x-apple-aspen-config.
Start a background task to keep the app running in the background.
Send a request to Safari to get the configuration profile from the app’s server. When receiving the profile, Safari automatically starts the installation. Once installation is done (or cancelled), control returns to Safari.
In order to return from Safari to the app automatically, additional steps are necessary:
- Define a custom URL scheme for the app so that Safari can return to the app (not its web server!) with a request.
- Configure the server to first send an HTML page that reloads itself periodically.
- Configure the server to send the configuration profile for the first reload, and a redirect to the app’s custom URL scheme for subsequent reloads.
- Respond to the custom URL scheme by shutting down the web server.
Installing a configuration profile on iPhone - programmatically