ios 8 openUrl itms-services does not exit current app
Asked Answered
S

3

19

In iOS 6 or 7, the app exit to the home screen when I call UIApplication openUrl with a url of itms-services://XXXX to install a new version of my app (using enterprise deployment with ipa files).

In iOS 8, this is no longer the case. Now the app continue running just as nothing has happened, but if I go the home screen, I can see my app icon grayed out, with a downloading pie chart about 66% completed and the text "Downloading..." below. If I now wait for a while (less than a minute), the application is installed correctly and I can start my app again.

Has anyone else experienced this behavior? Have anyone seen any documentation regarding this? I can accept behavioral changes as long as it is documented, but I haven't seen any documentation regarding this.

Sain answered 18/9, 2014 at 13:19 Comment(1)
I'm experiencing the same "difficulties". We have built an app for providing in-house distributed apps (kind of in-house AppStore). In iOS7 you received notifications for the system dialog asking the user, wether to install an app. In iOS8 these notifications are no longer sent. Previously we could start a timer and poll for the expected URL-scheme of the app to be installed to provide some activity indicator to the user. With iOS8 I cannot even distinguish if the user selected to cancel the installation. :( Couldn't find any documentation on that, too.Littlefield
A
0

Yes, you also get the same behaviour when clicking a download link in safari now on iOS8.

I'm not sure why they introduced this change but there isn't really a way around it (unless you force your app to crash with something like exit(0);)

Also, the itms-services url scheme is undocumented and is technically a private api. From experience, you're not allowed to submit apps to the App Store that use it.

Algy answered 18/9, 2014 at 13:44 Comment(4)
Is itms-services undocumented? There was earlier documentation at developer.apple.com/library/ios/#featuredarticles/… but that link is dead now. Have Apple removed all documentation of itms-services? I cannot find it anywhere! Deprecating stuff is one thing, but just hiding it is just BAD.Sain
Yeah, It's not good... I thought i remembered seeing something ages ago but could never find it again so assumed that maybe what i saw wasn't official apple docs... Its really weird about the documentation, when iOS7 was introduced they made it a requirement that the manifests are https links but didn't really make it clear as well.Algy
I am pretty sure that there was official documentation about this, even Xamarin (which I am using) has a link to the same page that now is dead: developer.xamarin.com/guides/ios/… .Sain
In the book iOS Deployment Reference (free in iBooks) which has the iOS 8 on the front page that should indicate that it applies to iOS 8 as well, there are instructions of how to contruct a website with itms-services links to distribute apps. So there is some documentation for itms-services for iOS 8, but I cannot find any reference documentation.Sain
A
6

While forcing the app to crash will technically work, a much better solution (allowing the user to retain the state of the application) would be to simply background the app launching the itms-services link by executing the following.

[[UIApplication sharedApplication] performSelector:@selector(suspend)];

We use this in an app used for distributing test builds to our testers and it works very well, and eliminates the confusion of a tester trying to install an app and having the app stay in front. It also allows them to return to our distribution app and have it pick up where they were.

Aqualung answered 23/11, 2014 at 17:58 Comment(5)
Awesome.. I assume this is a private API? Obviously not a problem but i just wanted to confirm... Do you call this immediately after calling openURL:? Just because I wasn't sure if the install popup will still be shown if that was the case?Algy
Yes, right after openURL - the popup will still be shown, typically after the app has suspended. We only do it for iOS 8 and up, since there is no need to suspend the app in the older versions. I would not use the call in an app going to the store, but if your app is installing other apps, I wouldn't recommend trying to put it in the app store anyway.Aqualung
What if I have the same problem but using Safari browser?Digiovanni
Unfortunately, I don't have a good solution for Safari. I doubt there is anything you'd want to do in Safari that would crash it, so you are left with possibly doing some messaging on the web page that would let the user know they need to hit the home button after tapping the install link.Aqualung
suspend is not in Swift. Any idea?Lambskin
A
0

Yes, you also get the same behaviour when clicking a download link in safari now on iOS8.

I'm not sure why they introduced this change but there isn't really a way around it (unless you force your app to crash with something like exit(0);)

Also, the itms-services url scheme is undocumented and is technically a private api. From experience, you're not allowed to submit apps to the App Store that use it.

Algy answered 18/9, 2014 at 13:44 Comment(4)
Is itms-services undocumented? There was earlier documentation at developer.apple.com/library/ios/#featuredarticles/… but that link is dead now. Have Apple removed all documentation of itms-services? I cannot find it anywhere! Deprecating stuff is one thing, but just hiding it is just BAD.Sain
Yeah, It's not good... I thought i remembered seeing something ages ago but could never find it again so assumed that maybe what i saw wasn't official apple docs... Its really weird about the documentation, when iOS7 was introduced they made it a requirement that the manifests are https links but didn't really make it clear as well.Algy
I am pretty sure that there was official documentation about this, even Xamarin (which I am using) has a link to the same page that now is dead: developer.xamarin.com/guides/ios/… .Sain
In the book iOS Deployment Reference (free in iBooks) which has the iOS 8 on the front page that should indicate that it applies to iOS 8 as well, there are instructions of how to contruct a website with itms-services links to distribute apps. So there is some documentation for itms-services for iOS 8, but I cannot find any reference documentation.Sain
B
0

I have experienced a similar thing. I have a web page for our internal app store and when I tap on the link I do get a prompt asking if I want to install and when I say yes safari just sits there. The app is downloading on the home screen but under IOS 7 safari would be pushed to the background and you could see where your app is being downloaded to and its progress. Now it appears like nothing is happening. I would love to correct this. Perhaps something has changed in the .plist files the itms-services protocol uses. This protocol is not private it is just reserved for enterprise deployments.

Babyblueeyes answered 24/9, 2014 at 22:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.