Loading a html 5 page within iOS app - ios

We are currently building an iOS app and we need to get it submitted asap, however, one of the features are not quite ready so I am thinking as a temporary measure to put in a button which when clicked opens an external page with a html 5 web page within the app and the user can fill in their data and continue within the app as if they never left.
Obviously there will be some minor difference between the web page and the actual app but the key is we don't want people leaving the app, I just need the html 5 page to load inside the app so the user gets a good experience.
Is this possible and what is the best way to execute this?

Related

Submitting login form in WKWebView inside an iOS share extension causes the share extension to close

Background:
We are building a React Native app which allows users to create posts that include a quote from a blog post or news article. To achieve this, we have built a share extension, which displays a React Native view inside a modal. Inside the RN view we are using react-native-webview (which renders as a WKWebView on iOS), to display the page that was shared, allowing the user to select some text on the page (which is fed back to our app via an injected content script), and continue to create a post.
The problem:
Some news sites that our users want to share from have paywalls, e.g. FT, NY Times etc. - on these sites the user has to log in inside the webview. It's not ideal, but once they have logged in, as we have cookies enabled on the webview, their session will be remembered. This solution works well on Android, and works well on iOS when sharing from Safari.
When sharing from an app on iOS however, once the user submits the login form inside the webview, the share extension closes, taking the user back to the app that initiated the share action.
Here is a video demonstration of the issue occurring in the Guardian app:
https://www.youtube.com/watch?v=DFnh1x3j4xs
Observations:
When observing requests that occur within the webview using the onShouldStartLoadWithRequest prop of the WebView component, upon submitting the login form, there are two requests where iOS reports the navigationType as formSubmitted.
By checking the navigationType inside of the onShouldStartLoadWithRequest method, I was able to allow the first formSubmitted request to go through, but cancel the subsequent one. This prevented the share extension from closing, but upon clicking a link to go back to the home page, the share extension was closed.
My current theory is that the app which initiates the share, is somehow hooking into the form submit event, as these apps generally use webviews for their own login process - so although this webview is running in our own process, perhaps the app still somehow hooks into the process.
It is worth noting that this behaviour is inconsistent between news apps, presumably due to differences in the way they handle their login process.
Initially this issue was occurring in the BBC app as well, but at some point stopped occurring without us making any changes, so it is somewhat intermittent, or perhaps based on stored data/cookies.
Summary
We would like to fully understand why this behaviour occurs, and we're hoping there is a solution or workaround that will prevent the share extension from closing when the login form is submitted.

Is load testing is possible on iPhone app?

I want to test the reaction of app when 1000 user hit on my app. So is load testing is possible on iPhone app?
Hi #Vaibhav let me summarize the load testing, for applications I always load test their Api, you can't load test a mobile application.
But if you still want to check mobile application with certain number of clicks, I automate the mobile application and mark a locator to be clicked multiple times for a single request, you can manage rampup time with "click and wait" but not exactly like the api testing, you can also maually give time after each click. This is the closest I have go to test a mobile application for load.
If you need further help hit me up in the comments and I will share my method wih screenshots.

Handling Custom URL Application Start in ios

We have link functionality in our web application that when clicked, browses to a page on our server that performs the following:
Tries to open the custom url to our ios application
If this fails, it redirects the user to our ios app store to download the app.
This actually all works perfectly well.
However, it creates a weird corner case, where after a user has done this and finished, if they come back sometime later and open their safari on the same phone, if our web link is still the active tab, it will redirect them again to our application.
The cause of this is fairly obvious, but we are struggling to come up with a solution for it. Is there any known to rectify this behavior, either through a different mechanism then I described for opening the application or through somehow killing the page simultaneously?

"Add to Home Screen", save state without app cache?

I have a web site that I'd like users to be able to add to their home screen. Users will switch between this saved "web app" and a game frequently.
The first problem is that when a user comes back to the saved "web app", it displays the splash screen every time even though it wasn't closed. This is undesirable. Further, when a users clicks on a primary navigation element, it switches the user over to Safari.
How do I get the app to "save state" and not re-load the app when coming back to it (when it hasn't been closed)? How do I get it to load links clicked within the same domain to load within the saved "app" rather than loading them up in Safari?
Safari doesn't reload a page when you switch away from the app and come back, so why does a web site saved to the home screen have to reload when pulled to the front?
I don't want to use an offline database, I don't even need the app to work while offline because it needs to tie to a live database that's constantly changing. Therefore a working offline isn't intuitive because the data would be outdated and irrelevant. Therefore, I don't need cacheing either (except maybe a few resources that don't change often). I just want the darn thing to "save state" and not reload every time the user comes back to it. And links clicked within it, shouldn't take the user out of it unless they are links to a different domain.
I've searched and read and searched and read, but I'm not finding anything other than articles about making a web app work offline. That's not my goal. My goal is to make it behave like Safari does in that if it's not explicitly closed, it keeps it's state.

How does the Facebook app for iPhone work?

I will soon be writing a native iPhone app for my web site. The web site is already mobile optimised so could potentially just sit in a UIWebView. How does the Facebook app work? Does it do something similar?
If I did use a UIWebView then how would I store user credentials so they don't have to log in every time and how would they upload photos? These are my two main requirements.
The facebook app is going to be a native app. It is different from the mobile website.
There are two things you can do here. If you're going to make your native app just a UIWebView then don't bother! You can have an apple icon embedded in your website which will show if a user bookmarks your website on their home screen. To use this use the <link rel="apple-itouch-icon" href="/apple-touch-icon.png" /> code to do it.
The second is make a fully native app. I know the benefits of a UIWebView app, but the negatives are plain to see. UIWebView apps are tacky, nonfunctional and terrible to use. A mobile website is not an app (unless done very well). You will have links to click, pinch and zoom, awful bounce effects on the web view, links that may possibly allow users to navigate away from your mobile website but within your app. Again, unless done cleverly, you will have to provide browser controls on your app which will make it look like a tacky web browser.
My suggestion would be either stick with your website, optimise it for touch based input, make it a really good mobile website, or create a fully functional native application. Remember not all websites need to have an app to go with it. If your app isn't necessary then its merely counter productive to make an app for it. I don't know about anyone else, but I spend more time in my web browser than I do in apps.
With regards to uploading and auth then a) auth should be done already in your website. A UIWebView is just an instance of safari working within your app, so it will be able to get and store cookies and all sorts. I believe these degrade at the end of the app session, however its easy to pass to the objective c and store in an stored preference. b) uploads not going to work even if you put your site in a web view. You will have to (at some point) hand off to an upload screen in your app which is running natively.
I would suggest that you start off with a simple native app. Let the users log in, upload stuff and do other basic stuff - whatever they can't currently do on your mobile website. Then move on to other things as people ask for them, or as you have the time to make them. You don't have to launch your app with a fully functioning version of you website (in fact this would be silly because the only thing they cannot do on your mobile website on their phone is upload stuff). I'm sure people will request features as your product evolves.
I would take a look at PhoneGap, you can get access to native device features through javascript http://phonegap.com/

Resources