Install MDM profile via SafariViewController - ios

I was wondering is there a way to install the profile(.mobileconfig) via SafariViewController. I'm aware that only Mail.app and Safari.app have the privileges of doing so.
So, if there is way that SafariViewController can handle such request, please let me know.
Thanks,
Yathish

It looks like it's possible to install mobile configuration profiles (.mobileconfig) via SFSafariViewController since iOS 11.3. I confirmed this on both iOS 11.3 and iOS 12 beta.
See here for more details: https://forums.developer.apple.com/thread/103337

As the documents written for SafariViewController(https://developer.apple.com/library/prerelease/ios/documentation/SafariServices/Reference/SFSafariViewController_Ref/index.html), are saying that the SafariViewController is minimizing the work of developers who need to create UIWebView inside the application which need to show the web interface in application.
On the other side Safari.app is a different iceland where things are going on, and our application is a different one. Apple granted different level of permissions to applications. Based on that the Mail.app and the Safari.app are enabled to install the .mobileconfig(configuration files).
As we Apple is very much clear about the functionality of the SafariViewController, they will not allow us to install the .mobileconfig file from out applications with SafariViewController.

Related

How can I check programmatically that list of applications are installed or not in iPhone

In my app I'm showing list of applications.Is it possible to find that the array of applications are installed or not in iPhone.
If any possibility is there anyone please provide related code in swift to check the array of applications is installed or not in iPhone.
In the old times you could have used canOpenURL with a library like iHasApp. This only works for apps that register custom deep link schemes, but it was capturing the majority of important apps.
But since iOS 9 there seems to be a limitation to this approach - see How to reset `canOpenURL` limit in iOS9?
In general your app is not allowed to know what else is installed in the system for privacy reasons.
From your sandboxed application
By default from an Application Layer, you are not allowed to use the private API's to check what other applications are installed on your device.
Workarounds
If the target third-party app supports URL schemes. You can check the url scheme they implement using [UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:#"someScheme://randomText"]] .
(Not recommended)Take a look at private frameworks like /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices LSApplicationWorkspace . There is a method called allInstalledApplications in LSApplicationWorkspace which should work, check runtime headers for more info.
Off topic ~ For MDM devices
Using Mobile Device Management (MDM) protocol, you can use InstalledApplicationList command to get the array of installed applications on the target device. The following is the response for the said MDM command.

ios Application - Manually Installation for a Custom Application

I am currently developing an iOS application for iPhone and iPad and i need to manually install the application without the need for xcode.
Is any way to install the custom application manually like the way i do with android. For example to copy the package to the phone and install it?
The idea is to update the application after every bug fix without the need of xcode because the client does not have a mac.
Thanks!
If I understand your question, then my answer will help you.
As your client doesn't having mac and assuming that you have created a build of app u want to install with valid distribution certificate.
Just upload your build here - http://www.diawi.com (You can upload provisioning profile too)
It will give you a link. just send that link to your client and let hih/her open that link in iDevice's safari browser. Then simply hit install button to install app.
Use TestFlight.
EDIT: If you want to client to know update about app, then I will suggest to go for TestFlight as you can mention the version and also can add comment about each build updated there and client can read it by logging in that app from it's device.
Easy way, Make its .ipa file upload it on here - http://www.diawi.com, it will give yoy url, this url give yor client and open it on safari, your application will install in client iphone without Xcode.
They can do it via iTunes or iPhone Configuration Utility. Refer the link

Way to install mdm certificates programmatically in app

this may sound a bit dodge, but im working on a parental app/browser lockdown app, and the use of the mdm service is basically the functionality i need, but i want the users to be able to control the mdm services for their childs device through a website.
I have everything working, except at the moment im not sure if there is a way to actually install the certificates needed programmatically in my app. I can do it manually through safari, but that detracts from the apps experience.
I basically want to mimic the functionality safari gives when downloading these certs but in my app.
has anyone tried something like this before?
alternatively, is there a way to get a UIWebView to respond to the mime-type of application/x-x509-ca-cert and application/x-apple-aspen-config ?
My knowledge of this could be outdated because I tried this on iOS 5.X. So, be aware.
At that moment, you weren't allowed to install certificates from your application (so UIWebView with application/x-x509-ca-cert didn't work). I believe an app should have special entitlement (which only system apps can have) to install a certificate to iOS' trusted certs store.
I believe the same is true for configuration profile installation via UIWebView.
By the way, here is an old discussion about it: https://groups.google.com/forum/#!topic/iphonesdkdevelopment/8QDPE1juB2g
However, I think you should try it now. Things could have changed.
Now, regarding installation of configuration profiles through Safari. I am not sure whether you are doing this completely manual or semi-manual, but just in case if you are doing this completely manual, here is the code which will allow you to partially automate it.
NSURL* url = [NSURL URLWithString: #"<URLOfPageWhichHasConfigProfile>"];
[[UIApplication sharedApplication openURL: url];
This will switch to Safari, which will switch to Preferences after that and after user approval it will get back to Safari. I know, it's not perfect.

Application with plugins is possible in iOS or not?

I just want to know that can i make an application which have some plugins in it, when user install that application then some plugins also get installed? for example I make a plugin which have some smilies and when i open Facebook application all that smilies get available to me in that application and in my application also.
Still what i studied is that you cannot make any thing for iphone that wants to make change or access OS level. SO this in not possible for iOS. But this is some how possible for JailBreak

iOS: Possible to install configuration profiles on device without going through safari?

I'm trying to install a .mobileconfig file through an application without going through the Safari or Mail apps.
At the moment, I can download the file in my application, but still have to pass it to safari to handle. This means that the user gets dumped back in safari after they've installed the profile, whereas I want to return them to my application.
The docs mention that Safari looks for the .mobileconfig extension, which it presumably passes on to the Settings app. Is there a way to cut out the middleman, like a prefs:... URL scheme?
I've searched for a while and tried everything I can think of - no luck so far. It looks like you have to go through Safari to do it.
To improve user experience, you can launch Safari with a page that you host that 1) allows the user to install the configuration profile and 2) allows them to come back to your app via a custom url scheme (yourapp://app/check_profile).
I posted an answer with code which does what akhomenko mentioned, but automatically (no user interaction required), here: Installing a configuration profile on iPhone - programmatically

Resources