I want to get back some response to browser from application.
Like if I come into application from browser to application using deeplinking then I handle some changes into application and I want to retrive those changes into browser from application.
So help me how it is possible.
That's not possible. What you can do if you need to interact with a web site is to present the user a web view inside your app. That's actually a good practice since you don't send the user outside of your app.
The web view has some delegate methods were you can catch requests and linking.
You can deal with URL schemes by adding them in your website and make your app handle them. You can pass information in the URL and retrieve it in your app by parsing the URL.
Related
I am creating a flow that:
1) takes the user from my iOS app to my website through Safari
2) and then navigates back into the app via javascript
However when I try and redirect the user back to my app from my site using url schemes, i get the familiar "Open this page in 'appName'" alert.
Is there a way to avoid this alert from showing up? Is there some way to whitelist my website as a source for my app to allow me to direct the user back to my app w/out any alerts?
It seems like it might be possible with Universal Links, but I am wondering if there is a simpler way to do so.
EDIT: I should have mentioned that I have the unique requirement that I need to use Safari. I am processing donations in my app, and Apple requires you to go this through Safari and not a webview. Any ideas? –
You can achieve this using webView instead of Safari,so that
control will not go out of the App.
Now the problem is how to get the click from webView, for that you can
use this approach
How to invoke Objective C method from Javascript and send back data to Javascript in iOS?
I have integrated this approach in my App so this approach will work for sure. It feels like you are in APP & some times it will diificult to differentiate between WebPage & native page
How do you import or display an application inside another application?
It is like, it will be a part of the app where you can use it's functionalities. Maybe in full screen or not in full screen. My thoughts are these are web based and is being opened in a UIWebView to use the functionalities.
Extensions? It's more like "piggybacking".
Here's an example:
https://hub.united.com/en-us/news/web/pages/uber-on-the-united-app.aspx
I'll post an answer regrouping my answer and also #Popeye one that seems valid too.
There may be a few ways to do it, each ones of them may act differently.
The other app offers a public SDK/API/WebServices
As an example, I'll take FaceBook API, that allow you to login giving you a UIViewController (that you can customise), and allowing you to ask for some data through their WebServices (like who are the friends, etc.). You're still inside your app.
The other app offers you a private SDK/API/WebServices
Same as the other one, but it more like a parternship. You're still inside your app.
URL Schemes
The other app gives you a few way to interact with it. They check if the app is installed, and launch it with some parameters, or if not, they may redirect it to the app in the Store, their website, etc. More info about URL Schemes from Apple Doc. You have to check their documentaion to know how to interact with it.
I developed an ipad app where in i have a situation where the user taps a button which redirects to a login page (UIWebView),The user enters his credentials and web page hits a server where the validation takes place and the browser is returned a feed back string (authorization).
Question:
Is there a provision to know the feedback string/data by the application? According to my knowledge as soon as a webView is launched our application has no info about the happenings on Webview.
I don't want to implement services in my application since the service provider says that the webpage redirects the user to app upon successful login.Which may be possible on a desktop,but in ipad application can the bowser/Webview redirect back to the application upon login and more ever i need the feedback string in my application.Can some one suggest how could i implement the same.Please correct me if i am going wrong...
TNQ
You can call Objective-C methods from UIWebView. This you can do by trapping your custom urls in the shouldStartLoadWithRequest: method. More details are here.
I have a requirement for an app to communicate with a server, this communication is done using a proprietary http based protocol and the app uses NSUrlConnection for this.
However before the app can be used the user must first perform a one-off registration, and the requirement is that this is done by them logging onto a web page which will be downloaded and displayed in a UIWebView. As a UIWebView is used I no longer have access to the HTTP header/body nor the NSURLConnectionDelgate etc. for this part of things.
My question is, how can the app know if and when the user has successfully logged onto the web site?
It sounds like you want to implement some code in the connection:didReceiveAuthenticationChallenge: method of the NSURLConnectionDelegateProtocol. There's more information about how to respond to a challenge here.
Let's say I have a web app that calls out to a native app via a custom URL scheme, and after the native app has done its thing it returns to my web app by opening a callback URL.
This all works fine when my web app is running in Safari. But what happens if a user saves the web app to the home screen (creating a "Web Clip")? In that case it runs in a separate process from regular safari, and has separate cookies and cache.
So when the native app tries to return to the web app, the URL will presumably get opened by Safari, not by the Web Clip, and the session will be lost. (And not just the session -- all the page state, which in a rich Javascript-based web app can be a lot of stuff with non-trivial startup time.)
Is this assumption correct? And if so, is there any way around it? Is there some way to get iOS to try to open the URL with a web clip if installed?
In order to have something launch via a custom url scheme on iOS, you must have an application register this information via the Info.plist built into the app.
It is not possible to have a webapp/webclip register this information system-level.
So, to answer your main question, you cannot do this.
Here is the information on implementing custom URL schemes in native applications.