In iOS, is it possible open a url in safari, then go back to the app and reopen safari without pushing a new url? - ios

I have a simple app that opens a link in Safari with UIApplication.shared.open. The user might navigate to any number of urls in the site, and then hit the Back arrow in the top left corner as return to the app. Is it possible to launch Safari again, but without a new url, and simply open the tab at the same url location where navigation stopped, prior to pressing the back button? The only way I know to open Safari is to push a url it, which means a user cannot resume using a site in Safari where they left off. I would appreciate any ideas on how to implement this feature.

Related

How create an iPhone app that just starts a website

How do I create an iPhone app that just starts a website in the default browser?
I'm not looking for a browser inside an app, just goto the pre-programmed website and close the app.
What do I need to get this accomplished?
What you're talking about is homescreen shortcuts you can create out of Safari. Unfortunately to have a native app that just starts the webbrowser is not possible.
Here is how you create a homescreen shortcut:
1. Tap the share button in Safari
2. Tap "Add to Homescreen"
3. Confirm or change shortcut title
4. Done. See the shortcut on your homescreen

Is there a way to prevent Safari on iOS from clearing the cookies for a website on close?

One of the users of my mobile web app is complaining that he has to log back into the app after every time he goes to use it after he turns his phone screen off. What's happening is Safari clears the cookies for the site when the screen goes off (or when you close safari out completely by double tapping the home button and sliding safari away). If you open safari back up though it will show the last screen you were on but you can't use any session data because it's all gone.
Is there a way to prevent this in safari?
If you don't add an expiry date to your cookie, Safari will add an expiry time of session.
Exmaple Here - developer.mozilla.org

Return from Safari to IOS application with UIAlertView

I opened a link in safari browser, its a web page for online Payment, I want to do is that when user press cancel button on webPage then it will show alert view in safari and come back to application and when user press ok then it open iOS application again, I do not have any reviews for this. I need help about this.

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

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.

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.

Resources