ios 8 openUrl itms-services does not exit current app - ios

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.

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.

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.

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.

Related

why does my phonegap app restart if kept in background for long

my phonegap app restarts if kept in background for long. For example if i open my app the next day it relaunches rather than starting from where i left off. Otherwise it seems to preserve state perfectly.
I see this happening for some other apps too that are installed on the iphone like instagram, twitter, but not for facebook and whatsapp. Does iOS kill apps if in background for long? Can i prevent this?
I am using Phonegap CLI 6.0.1 (cordova build version 4.0.1) testing on iOS9. Let me know if any other information is needed. Thanks!
iOS will kill apps when it needs the resources. There is nothing you can do to prevent your app from being killed (by iOS or the user). This has nothing to do with your app being made with phonegap (or anything else).
You need to code your app to handle being killed. When the user chooses to use your app again (after it happened to be killed), your app should launch right back to where it was, restoring its previous state. This is what all good apps do.

iOS development, Natively open an App in my App

I have a project where I have to open an App like Facebook inside my App.
I know the URL Scheme but it is not what I want. I don't want to left my App and have like a webview but for a native app (Facebook for exemple).
Same behavior than.
Is it possible ?
Thx a lot :-)
No, this is not possible. At least not on a non-jailbroken device (there might be hacks that can be done on a jailbroken device to achieve this that I'm not aware of).
No this is not possible. You cant open another app inside of your current app. You can open an app from within an app but you cant frame that app inside of yours.
Other than the fact that apple has prohibited and not made this available, it also will cause a poor guest experience. The apps are designed to run on the users device, not a smaller screen.
it's impossible to open another app in a running app, but you can open a webapp

iOS 8 enterprise apps are stuck in limbo inside the device

In trying to release a new update to one of my enterprise iOS apps, I'm finding that the OTA download is failing. It will give me the "Would you like to install 'xxx'" alert, and tapping 'Install' is about as far as it will go. There's no indication that anything is happening. This occurs on my iPhone 6 and iPad both running the most recent release of iOS 8.
Running the devices on the iPhone Configuration Utility, it shows the list of installed apps, and the one app that is refusing to install has an "Install" button where all the others have "Uninstall." In the screen cap below you'll see the renamed bundle and the original bundle.
When I click the "Install" button, the iPhone Configuration Utility crashes.
I managed to get it to work using a workaround that I found elsewhere on StackOverflow, which requires renaming the app's Bundle Identifier, but it still seems like a pi$$-poor way to do it.
It seems clear that the app is somehow stuck in limbo, showing up on the app list but not showing up on the iPhone screen, and also is refusing to be overwritten. My question is, is there a way to purge the old app from the iPhone's memory, and possibly reload it using the original Bundle Identifier?
Apple still hasn't fixed this correctly in even the latest versions. There are several manifestations: the app does download, but the device doesn't quit the calling app, so you don't know if the app downloads or not. If the app was never on your device before, it usually downloads. If it was there before, and was deleted, it doesn't download. If the downloaded app is already running in the background, or you're doing in-app downloading, it often doesn't download because it doesn't want to replace a running app. I usually start the download, then switch immediately to the springboard to watch it download. If I see the clock dial on the app icon, then I know it's downloading. Changing the bundle is not a good thing, not to mention not giving any user feedback when you tap "Install."
As far as updating the app from the in app prompt.
It's a problem with apple/ios8. They aren't exiting the app after the install. If you quickly tap the home button after you hit install. Occasionally you will get a successful download.
For future use you could find out a way to use exit which will kill the app but apple warns against using exit due to poor user experience. But if apple isn't providing a good user experience in the first place for this process I think this warrants the use imho.

How to removed killed app from recently used list (iOS)

I am developing a helper for an automated testing suite. There is a requirement to kill/reset the application being tested, so the app can be started again "fresh".
I know killing an app is against Apple guidelines; there are many questions here about that with sensible answers ("don't do that!"), but this is a different scenario; and the app will never be on the App Store (as it has been instrumented for testing purposes).
Currently, our helper calls "exit(0)" from within the app to terminate it. This works fine, but the app icon is left in the recently used apps list (double click home button).
I need a way to programatically remove the icon from the list (or, terminate the app in such a way the icon does not remain). Or maybe a way of refreshing this list somehow. The only way I have found so far is to uninstall the app and install it again.
This must work on the device (as well as the simulator). I can use solutions that make use of USB-only functionality (e.g. provided by libimobiledevice and friends), or calling a function inside the app, or a Private API call. Assume the device has a development profile on it. Jailbreaking is not an option.

Is it possible to have a running background app on iOS

This is a strange one, I have a need to create an iOS app that runs in the background on an iOS device, but can not be visible on the Home screen of the device. The app may need to show up in Settings to configure a few options, but it mostly needs to run behind the scenes.
I do not need to publish this app on the app store, it is strictly an enterprise app for my company.
Does anyone know how this kind of behavior might be achieved? Configuration profiles? API's? etc?
Edit: Jailbreaking the device is not really an option for us. We have to keep the devices as they are.
Backgrounding
There are several methods to get permanent background execution:
a) Silent audio which is mentioned by JRG-Developer
b) Usage of beginBackgroundTaskWithExpirationHandler + turning location manager on/off (it will reset remaining time to 600 seconds)
Making app invisible
You can use SBAppTags in Info.plist (take a look at this: How to remove app icon programatically from jail broken iPhone app?)
It will make your icon not visible on Home screen.
I've no idea how you can tackle the not be visible on the home screen criteria, but there are certain services that are allowed to be run in the background continuously, notably:
Background Audio (even silent audio)
While this is indeed very hacky, short of jailbreaking the devices, this may be your best bet.
While it's unlikely / very difficult to get past the review process, in the event for some reason you do need to (attempt) to publish this app to the App Store, some apps are even available on the App Store which take advantage of this hack, such as PasteBot.
You should definitely read their write-up here about getting their app's Cut-and-Paste functionality to work while in the background:
http://tapbots.com/blog/pastebot/pastebot-music-in-background
Another out-of-the-box idea, why not use Android devices instead, which do support multitasking?
Two methods:
Jailbreak. A jailbroken iPhone is essentially a Mac and you can use all Mac UNIX programming tricks - spawn a daemon (you can even ask launchd to do that), or something. You can set up enteprise-wise Cydia source. Refer to saurik's website for a walkthrough and set up an experimental server using Ubuntu (which used apt too)
A non-jailbreak way may be possible, but it will depend on what your app is doing. You can try use enterprise-wise push notifications.
Given that this is impossible to do on non jailbroken phones, I'd suggest the following:
develop a directory app, or a phone list app, something that is specific to your company.
have it connect to a web service once a day to register the device ID (so you know the user has not deleted the app)
tell users they need to keep the app open at all times (and if a user's device does not register one day, send them an email asking them to launch the app).
Now you can send back whatever you want with the app. If they kill it, you'll know the next day when you have a script look at the logs.
If you think this is a terrible idea, it is, but its the best you are going to get on iOS right now.
EDIT: you could send a notification every day - say in the AM - to make sure the user opened the app if it wasn't running.
From my experince, this kind of behaviour cannot be achieved on iOS. When an app enters into background, it is active only for a small particular amount of time. After that, it goes into hybernate state. It stops working. So the behaviour you said can not be achieved without abusing iOS workflow. Thats why some call iOS's multitasking as not true multitasking. Only jailbreaking might help your case. That was for one case. The second one where the app cannot be seen on home screen is again, impossible. It has to be on springboard to run.

Resources