Performing a task through a website and going back to an iOS app - ios

I'm developing an iOS 7+ app that I need to offer the option of navigating to a certain web page to let the users to fill in a form there, and after that to come back to the app's view where the user was.
Is it possible to programmatically open Safari with a given url? If it is, I suppose that then there is no way to automatically redirect the user to your app from there... right? Is then a UIWebView the only option? Is it possible to navigate back or dismiss the view with the UIWebView without the need of user interaction?
Thanks

You can open links in Safari as detailed in this post How to launch safari and open URL from iOS app
I don't believe you can set a 'callback' and have it return to your app on completion, as you have no control over the user once they have exited your app's sandbox.
Opening the link in UIWebView would provide control, as you can utilize the UIWebView callbacks.

Related

Create home screen quick actions that do not open app?

I have home screen quick actions for my iOS 9 app, but I don't need it to open the app. It actually schedule reminders and that's it. Is there a way to make the home screen quick action not to open the app?
Quick actions are designed to be used to quickly navigate to a section of your app, eg on the camera app there is selfie mode, box mode, panorama mode, timelapse mode etc. These are all sections of the app. To the best of my knowledge you cant have a quick action that just runs code without opening the app. Otherwise how will the user know that the code has worked and it has been executed?
This functionality would be cool but i believe it is impossible as of current. The closest you can get is make it so it opens the app to a ViewController that just says "Reminder Scheduled".

Is it allowed to add a UITabBarItem that opens up Safari?

I want to add a UITabBarItem on the TabBar which when clicked opens up Safari instead of loading its corresponding tab. (Not UIWebView but the app goes to background and opens up Safari instead)
I already know how to do this, but I was wondering if this is allowed by Apple. I know they're OK with using the TabBarItem to trigger other actions such as opening a modal in the app, etc. However I am not sure if it's OK to open a safari.
I am just being cautious because I don't want it to get rejected for this and wait another week.
I don't see a reason why it shouldn't be allowed.
But: it could lead to confusion amongst your users, because they would most likely not expect that touching an item on the TabBar leads to an app switch. I would rather open a webView and offer the additional possibility to open the page in Safari.
There is no harm doing such and it is also allowed by Apple.
But, I would personally suggest to use UIWebView, over Safari navigation. Because it will create unhealthy user experience, where he/she requires to jump around to swith in-between Safari and App. Rather you can open the same link in UIWebView, which will kepp our user in app only.

UIWebView does not show AlertView as per image

I have to update my app to handle the situation as per the image shown. It used to work when I logged into the website and the login for was just displayed as a normal website.
But now since the update it comes up as a UIAlertView, I have seen this similar when I log into my router at home.
However the UIWebView in my app does not show this alert. Mobile Safari does show this.
Is there any way to get the UIWebView to show this or is it just suppose to come up when required?

ios sdk show alert without launching the app

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.

Locking iPad to Safari and one webpage

Can you somehow lock an iPad to Safari and only one webpage? I've found people locking iPad to certain apps but can't find this anywhere.
One app example:
Lock-down iPhone/iPod/iPad so it can only run one app
From the accepted answer to the question you link to:
It is possible to put an iPad or iPhone into 'Store Demo' mode so that the home button and swipe to home gesture is disabled. If you have seen the iPads in the Apple Store running the smart sign apps then you will know what I mean.
So you could, for example, lock the device to Safari. But then it would be possible to navigate to any webpage.
What you need to do is to write a simple app that has a UIWebView that loads your site, and then put the device in 'Store Demo' mode afterwards. Also, depending on whether your site contains links to the outside world, you may have to implement webView:shouldStartLoadWithRequest:navigationType: from the UIWebViewDelegate protocol so that it refuses to leave your site.

Resources