How to hide multitasking snapshot in iOS? - ios

I am developing a security application. I need to disable the multitasking snapshot from being taken by iOS. I have made a fix for this by adding a black screen over my application window, when application resigns active mode. This logic seems to work fine when I press home button. But when I lock the screen, the logic is not effective, since the snapshot is already taken before control comes to applicationWillResignActive method. I have verified this by downloading the container folder from devices tab. Is there any way to fix this?
Thanks in advance!

Related

Avoid external display to show native iOS screen when app entering background

My app has an external display when a second screen is connected. It displays the main content I want that people see while I navigate through others views. it works fine.
Is there a way to keep this external display active when app is entering background ?
I enabled background mode in Capabilities tab, I'm able to run code in background, it refreshes correctly when I enter foreground again.
AFAIK the answer is No.
As soon as your app goes to the background, it loses control of the external screen.

Switching between app and broswer ios

There is a scenario where tapping on link open's iOS native browser after which I need to close the browser and switch back to applicatio. Is there any possible way we can do the using Selenium commands.
Consider using sendkeys method to tap at home button twice. Then try to tap at some place in the middle of the screen to get back to previously opened app. That could work, but I have not tried it.
#vignesh You can't switch between different apps in iOS. Currently, appium supports app switching between android apps only.
But you can run you app in background and after specified time it will be foreground.
You can use the following code to move back from the browser.
driver.navigate().back();
Just try this out.

iOS caches the application screen when clicking the home button for the device

we are developing hybrid application on Worklight.
After the user launches the application on iOS, he will see the login screen, providing his credentials, he is inside our application.
Now, if the user clicked the home button for iOS before "logging out" from the app, the iOS will take a snapshot and store it inside the device cache.
By using IExplorer, I can see this screen cached, which in our situation a high critical issue.
How can I a override this screen with a white screen, in case the user clicked the home button of the iOS device it will be populated immediately, and the device will not snapshot the user main screen.?
Is there any thumbnail I can add to my nativeResource folder for iOS to solve this issue?
thank you.
I encourage you to look at the Worklight Knowledge Center. In most cases, you will find your answer.
To control the snapshot taken by the OS when moving to the background, you need to use the following API methods, depending on your needs:
WL.App.BackgroundHandler.setOnAppEnteringBackground and WL.App.BackgroundHandler.setOnAppEnteringForeground

iOS remove view before applicationWillEnterForeground

I'm developing an app on iOS 7 with a desired feature is that
When I home button, app enter background, I will add an image to current UIWindow. So when app enter background, if user double home button on iOS 7, os will show a small screenshot of current view of my app, so user can see my added image. :) (I did it)
When user return my app by clicking app icon, I want to remove this image immediately. In this situation, "immediately" means that user can NOT see this image anymore, user just see his/her current view when app enter foreground. I try to place the code remove image on the beginning of applicationWillEnterForeground delegate, but I'm still able to see this image for a short time after it disappears.
I also try to set hidden, alpha property for this imageview first, then removeFromSuperview, but it not works.
Can anyone help me to remove it "immediately" as my desire.
That is done automatically for all applications, you don't need to do anything in you code.
I don't think that you can do it faster, it depends of device performance. Sorry man.
Like other says it is really tricky how iOS handles these events. I've been researching and depends on the memory state of the device to do it faster or not. Indeed, in iPhone 4 and 4S may not show the image that you added on applicationWillEnterForeground method.
If I were you I would solve it by adding a smooth fade out animation of that image when the app becomes active again. With [UIView animateWithDuration: animations:] it could be nicely done! :)
If I find out something else I'll answer here!

iOS restore state issue

I recently upgraded my old iPhone app and the new state restore iOS 3/4 feature has introduced a problem. I don't know the name of this restore state feature - what is it called?
Here is my problem scenario:
I navigate into a detail screen on my app. I click a button to navigate to an address and it launches google maps as expected. Then I launch my app again. It briefly shows the last screen I was on, but immediately launches the google map again.
What I want is to simply restore the detail screen that I was last on.
Any hints?
thanks
It is called multitasking, and it is built in automatically when you build under iOS 4.0+. Without you posting any code, it is tough so say, but why don't you put a breakpoint at the line that redirects to Google Maps and see what is calling it. Then you can backtrack to see why it is being called on the reopening of the app.

Resources