My question pertains to integrating a web app with a native app. A button in the web app opens up my native app, and then in my native app I want a "return" button. I wanted the "return" button to just resume safari from it's suspended state, but it seems like the only way to communicate with Safari is to open an http URL.
Opening an http URL will tell Safari to navigate to a specific page, but I don't want to alter the page which the user left off on, so I don't think this approach will work for me. Is it possible to just "Resume" safari from its suspended state?
Apparently this is not possible without jailbreaking the device.
This SO post seems to answer your question:
Open Mobile Safari without using openURL:url
Related
I have a app that I have to open safari for a payment and when it's done I want to back to app. is there any way to do this in iOS?I searched a lot there was a lot of examples for android but nothing useful for IOS.
after payment the last page would be : "https://madyar.org/BackToApp".I want when safari goes to this link, safari exits or hide and my app open again.
any advice?
In IOS, it is possible to launch another app from your app using a URL scheme.
But is it possible to have it then return to the calling app if the home button is then pressed?
What if Guided Access is enabled?
No sorry, The Home button will always lead to the users home, there is no way for developers to override that.
You can however have a button in the "called" app that will take the user back to the app that opened it. Facebook does this when going back and forth between their main app and their messages app.
edit Good answer from #shim about guided access in the comments. Basically if its on, you won't be able to leave the app so it doesn't do any good with this problem. /edit
Is there a way to not have this happen? I don't want to take my users to the safari browser before getting redirected to the App Store.
Right now if I send out an email link, it hits my server (for click tracking purposes), and then our server will redirect the to the app store. The problem is that this methodology will cause safari to pop open momentarily.
Is there a way to design it such that the user will not have safari opened and we can still track the click?
You need to do it in two different steps. First send a NSURLRequest to your server using NSURLConnection and separately open the AppStore URL.
Alternatively or in addition use the iTunes Referral Program for tracking.
I am creating a phonegap application that posts the login information to my website. When user signs off I want to come back to my app. Do I just send the url location along with the post data so that I can come back? or there is another elegant way?
Also when user clicks on the iphone home button, I want the application to exit. Currently it just saves the session and the page and goes back directly to the page if I start the application again.
I am using adobe phonegap site to build and test the application
From your description, I assume that you are navigating the Phonegap WebView (which is running your app) to the URL of your website?
If so, at this point you no longer have an app to navigate back to - the WebView has lost its handle on your app. In order to "navigate back" to your app, you should use the InAppBrowser plugin to navigate to your website. This will allow you to return to your app after the user logs out from your website. You'll need to somehow communicate the logout from your website in the InAppBrowser WebView to your app in its WebView. You may be able to achieve this with cross window messaging.
You can't "exit" an app in iOS - the OS does not allow you to do this. The best you can do is use the resume event to detect when your app has been restored from the background, then manually reset your app to its initial state.
The flow I am trying to do here is as follows:
user visits a page in my webapp with the chrome iOS app
user clicks a login link which starts a session and shows a link with an url scheme my iOS app can handle
user clicks that link and my iOS app opens up
my iOS app does it thing ( it authenticates the user )
when finished, I would like to be able to get the user back to the chrome iOS app on the same tab he started from. This tab is polling my server every x seconds to see if my iOS app has finished.
Is this possible? I can open up the chrome app easily just by using the googlechromes url scheme but this opens up a new tab. I need the user to land on the same tab
Similary for the safari app, I can get the same behaviour by using the https url scheme to open up safari.
Ok it seems it is not possible as explained here: Open safari in same tab from iPhone application
I guess it makes sense not allowing this, so other apps cannot manipulate your current open tabs.