what's mean about MDM ??
That stands for mobile device management. That’s a generic term but you can find information about this from an iOS perspective in the iOS Deployment Reference.
my problem is the VPN Server only support PPTP/L2TP, so the NEVPNManager can't work for it
Indeed.
btw You’re aware that we removed support for PPTP from iOS 10, right? So you’re going to be restricted to L2TP.
Then I create a .mobileconfig and drag into my project instead of programing, but how to install it …
iOS does not have any API’s specifically designed to install configuration profiles. However, you can kick off the installation process by opening a URL that points to a profile. This will launch Safari with that URL, which will bounce the work to the profile ingestion subsystem. Needless to say, this is a little indirect.
Most folks who do this host the profile on a web server. Trying to host the profile within your app is un-fun because a) you need to implement your own web server, and b) there’s some nasty multitasking gotchas.
My recommendations:
You should update your VPN server to support a more modern protocol. That will allow you to use NEVPNManager, and all of these problems go away.
If that’s not possible, put your profile on a web server rather than trying to serve it out of your app.
If that’s not possible, you’re going to have to debug the interactions between your app’s built-in web server and the profile ingestion code. You typically do that by:
Setting up a working case — That is, put your profile on a standard web server, point the profile ingestion code at that, and run a packet trace of its interactions when installing the profile.
Do the same for the non-working case
Compare the packet traces to see how the non-working case differs from the working case.
Correct any differences and repeat
For information on how to take a packet trace, see QA1176 Getting a Packet Trace.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"