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

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

Related

Firebase Dynamic Link doesn't redirect to the app when open through Safari

I have added Firebase Dynamic Link in my app, when I open in iPhone link through Google Chrome, it redirects me to the app, but when I'm trying to open app through Safari (I'm opening links through the Notes, not directly from the Safari), it doesn't open the app.
I'm testing on real device, not in simulator.
I have followed official Firebase Dynamic Links Tutorial.
What can be wrong and how is possible to fix that?
My problem was that in Xcode in Capabilities Tab in Associated Domains, in Domains field, I wrote wrong domain, instead of appplinks:app_id.app.goo.gl I wrote: appplinks:app_id.goo.gl, so i missed .app, after app_id, after changing it, it starts work correctly!
add applinks:appName.page.link to associated domain in xcode
https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_associated-domains
you can't open your app through safari , you can open it only by clicking on the link or scanning it(QR) using iPhone camera
One thing we discovered while trying to implement Firebase Dynamic Linking in our app was that the Apple App Association File had to be in the .well_known directory on the web server. Apple's app association documentation states the association file can be in either the root or .well_known:
Place this file either in your site’s .well-known directory, or directly in its root directory.
Setting Up an App's Association File
However, in looking at the web server logs when performing a fresh install of the app on a device, we saw calls being made to the .well_known directory. Once we copied the association file to the .well_known directory, Firebase Dynamic Linking worked as expected.

Downloading and Installing IPA from server if user clicks on button on Iphone

I am working on an app where I deploy the .ipa file and manifest.plist on my server and from there I try to install the app to my iphone.
The app is initially installed but I need to check if a latest version is available on the server. I have done this part and now wish to install the latest .ipa from the server directly to my phone without redirecting user to the html page of the server
Found some links on stack overflow, especially this:
Download and install an ipa from url on iOS
I have done this:
let endPointURL = NSURL(string: "itms-services://?action=download-manifest&url=myUrlString")
UIApplication.sharedApplication().openURL(endPointURL!)
I get unsupported URL exception. Can anyone tell me how I can achieve this? Is there any other way to directly start installing the upgrade without navigating to the actual html page?
It's just for testing purpose. Only registered devices are allowed to do this.
Only single way is there to download your app and its app store. You can give app store link and it will redirect user to appstore.
And if you want to test just use test flight it's easiest way.
Your linked question also tells that. Just for testing purpose it's possible now.
I found this same issue before.
A workaround for this is to new up a webview (you can hide it if you wish) and then give the request to the webview to perform. When the request loads you will then be shown the popup asking if you wish to download the app.

iOS - serving configuration profile via UIWebView

My question is: would it be at all possible to avoid the call to Safari so as to install the profile?
I am able to use the localhost server approach described in Installing a configuration profile on iPhone - programmatically to serve it through Safari, but would like to avoid having to call it and then have to re-open the app on confirmation...
I know Safari and Mail are supposed to be the only applications whose permissions allow them to launch those profiles, but since the Mime type is now public ("application/x-apple-aspen-config"), would there be a way to make it work with a UIWebView?
I found several resources talking about this (mostly saying it isn't possible) but most are over 3-4 years old, which makes me wonder if anything might have changed in the meantime, or if Safari and Mail remain as the only web-based "methods" to launching configuration files.
Apparently not possible yet (15/09/15).
Hopefully this will change in the future...

Automatically check for iPad app when downloading specific file type from website?

I think I already know the answer to this ("can't be done"), but I figured I'd see what people think...
On my client's website they're posting files for download that specifically need to be viewed on iPads using the Cadwork Viewer app:
https://itunes.apple.com/us/app/cadwork-viewer/id505161598?mt=8
You can't open the file on an iPad unless you have that app, and I'm wondering if when clicking on the file to initiate download if there's a way to scan the device to see if Cadwork Viewer is already installed. If so, proceed with the download of the file. If not, pop up a notice "This file requires the Cadwork Viewer app, download it here from iTunes." Something like that.
Again, I think this is just not doable, but hey...there's all sorts of things I don't know!
Thoughts?
Check out this link: https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html
You can add a banner to the mobile site that lets you open the app from Safari.
Explanation from Apple:
If the app is already installed on a user's device, the banner
intelligently changes its action, and tapping the banner will simply
open the app. If the user doesn’t have your app on his device, tapping
on the banner will take him to the app’s entry in the App Store.
This should be a good starting place.

How do Apple detect if an iphone app is installed when clicking on a pure html link?

I am trying to detect if my ipad app is installed on a device when visiting my website, in order to suggest different action to the visitor.
Thanks to this post :
https://stackoverflow.com/a/8310348/1128754
I found that the "store" application on iphone seems to have achieve to detect if the app is installed on the device. When you click on store links, it launch the app instead of going to the mobile web version.
For example, if you go to :
http://store.apple.com/xc/anythinghere
with an iphone on which apple store app is installed ( http://itunes.apple.com/app/id375380948 )
it automatically start the store app, instead of the web page.
I tried to follow the stack call with mitmproxy but safari doesn't seems to ask query before launching the app.
So, I guess they did custom url scheme recognition, with http:// links.
Do you think it is possible?
This is done with URL protocol handlers:
http://www.iphonedevfaq.com/index.php?title=URL_schemes#URL_Protocol_Handlers
You cannot detect if an app is installed from HTML, but you can launch an app. For example, the popular game "Doodle Jump" can be launched by going to doodlejump://, but if you don't have it installed, the link won't work. As mentioned, this is done with a custom URL scheme and needs to be coded into your app.

Resources