How to open downloaded application, when it is downloaded from itms-services? - ios

I have to write my code such that, i want to open downloaded app from current application,
I have URL Scheme of downloaded app, and able to open that app from current application,
But want to open app immediately whenever it is downloaded, also want to know if download is
canceled or any error is occured.
Can you please help me in this case.
Thanks.
Abbas

There is no notification that would ever tell your app that some other app has been installed.
Your only option would be to use UIApplication canOpenURL: once in a while to see if the app exists and then launch it if appropriate. But getting this right would be complicated.

You can't. The sandbox does not allow you to interact with other apps except to invoke them with a custom URL scheme.

Related

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.

Implement deeplinking to bring user to install an iOS app and after install take them into the app

I want to implement deeplinking whereby a user that does not have my app will be brought to the store to install the app, and after install they are taken into a specific part in the app?
The second part is not clear to me - how will user be brought into a specific part of the app after installing and launching it? Does iOS retains the link info?
The simple answer to you question is yes you can do those things but no you cannot do them in the way you want. You would not be able to launch to the app store and then once the app is downloaded launch into a specific place in the app. This is mostly due to security.
So let me explain, there is a method that you can call UIApplication.sharedApplication()canOpenURL(url) which will return a Bool on wither or not you app can open a url. If it comes back as false then you can assume the app does not exist on the device and you can call UIApplication.sharedApplication().openURL(url) where your url = NSURL( https://appsto./Path/to/your/app) then "The User" will have to click the download button.
Then if they try the action again you can callUIApplication.sharedApplication().openURL(url)withurl = (yourapp://).This will launch your application.
Now for launching to a specific place in you app you will need to setup schemes for your app. There is a decent tutorial on doing that here http://www.brianjcoleman.com/tutorial-deep-linking-in-swift/ and also a short synopsis of what you can do found in another answer to deep linking here Confused with IOS Deep linking
So you can get most of the way there but with Sandboxing you will not be able to launch the store, download the app and launch the app all in one move.
Hope this helps, cheers.

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 to start third-party app from my app in iOS?

I want to use an already installed app (ProCamera) from my app.On click of a button an already downloaded and installed app (ProCamera) should be launched from my app.I have searched and understand that its possible through custom URL scheme.But this app (ProCamera) is downloaded from AppStore,so can I add Custom URL to the downloaded app.
Please help me with possible solution.And also if this is possible or not?
Thanks
The only way to launch ProCamera is to ensure it has its own custom URL scheme. If there is none, you, unfortunately, are unable to launch it from your app.
Update: try this one procameraapp://

How to launch an app using NSURL and -openURL:?

There are a few apps which I find very helpful and want to recommend to my users inside my app. If one such app is installed, and the user taps the button, I want to launch that app. Otherwise open the app page in the App Store app.
UIApplication provides a -canOpenURL: method which I think can be used to check if an app exists on the device. With -openURL: an app can be launched. But how do I construct an NSURL to launch an app?
The apps I want to refer to don't have any special registered URL scheme, at least not that I know of. All I know is their name and app ID.
Is that possible or must the developers of these apps update their apps to support custom URL opening schemes?
It is only possible to open the app by url in case it has known registered URL scheme (it may me your application or one of the existing iOS schemes)
Here is a list of public URL schemes. This however is just a fraction of what is out there in the market. It may however be helpful for you.

Resources