ios sdk show alert without launching the app - ios

I have incorporated custom URL feature in my ios application. I would like to pop an alert on the browser itself when the application is relaunched from a screen other than home screen. I know if the app is relaunched from home screen or not. I am now popping an alert in the application it self. I want to throw the alert with out launching the application may be on the browser itself.
Thanks.

Since you can not do ANY UI stuff without having you app running, this will not be possible.

I think that is not possible, as when you are firing the URL, the control is in iOS Safari app. (Not in our custom app), and whatever you can do is - write code in your app only. So until your app gets launched, your code will not get to run, and alert won't be shown.
I am not sure if there is any other way around, this is just my own thinking.

Related

How to check if an SpringBoard alert / Safari browser popup is present?

Is there a way to check from the command-line terminal, if an alert view is shown?
I can ssh onto my iPad and wanted to check whether a basic-auth popup from either springboard or the safari browser is present. Does safari store the state of the alert in a specific plist/file on the device?
I can also run an app as a background service on the iPad, but will it capture the alerts shown in other apps? Can this be done via activator?
We ended up on using a Theos Tweak app and hooking in on show method of UIAlertView

Can I redirect to launcher screen from iOs App?

I am a newbee in iOS app development, and trying to create a small app using Xcode. One of my views has button to close the app. When a user taps this button, then I have to redirect the user to the "launch screen".
But don't know how. Can anybody guide me?
Thanks
First of all there is no way you can 'close' an app programmatically. The alternative solution is to force crash the app using the exit function.
you can use the code below:
exit(0);
Apple strongly discourages you to programmatically quit an iOS application. The standard way to move back to (redirect to) the Launcher screen (which by the way is Home screen for iOS) is when the user presses the Home button.
Calling exit(0), will not invoke the UIApplicationDelegate methods such as applicationWillTerminate: etc., and thus should not be used in general.
Reference of the Same can be found in Apple's Technical Q&A QA1561

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

Prevent application from entering background, requiring a code to close app

I would like to add functionality to my iPad app such that, when the home button is pressed and my app is about to enter the background, a message box pops up requesting a code. Only if the correct code is entered will the application go into the background, otherwise the app will not close.
Is this possible?
Short answer, no it's not possible.

Resources