Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building an HTML5 iOS app with UIWebView

I have a client who suggested we simply wrap an HTML5 app as a native iOS app by just creating a UIWebView and offloading all of the application-logic to the HTML5 app. This would allow us to have a "native" iOS app and a good mobile app for other devices.

However, this strikes me as a little odd and I was wondering what the pitfalls of such a plan would be. Does anyone have any experience doing this?

Thanks, Trey

like image 388
Trey Bean Avatar asked Nov 22 '10 20:11

Trey Bean


People also ask

Is UIWebView deprecated?

Apple is phasing out UIWebView, which is used by developers for integrating web content into an app in a quick and secure manner. Apple is replacing UIWebView (and WebView) with WKWebView, an updated version, as UIWebView has been deprecated.

Can you make an iPhone app with HTML?

Yes, you can.

What is UIWebView in iOS?

What is UIWebView? UIWebView is a deprecated iOS user interface control in Apple's UIKit framework. It loads HTML files and web content into an app view, rendering them as they would appear in a browser window.

Does iOS WebView?

WebView can be defined as an object which can display the interactive web content and load HTML strings within the iOS application for an in-app browser. It is an instance of the WKWebView class, which inherits the UIView class.


1 Answers

Any pitfalls you would experience as a web app you are likely to still experience. Don't attempt to do any OpenGL sort of app but if it's more like a webpage then this should work out fine for you.

However, using some frameworks out there you are likely to get a slightly "richer" experience in that you are able to access native phone tools that a web app isn't allowed to use (vibrate, GPS, etc.)

Take a look at PhoneGap. They lack extensive documentation but there are quite a number of people using it and have already 'ran it through the gauntlet', you could say.

All that said, if you don't want to deal with the marketplaces (iTunes, Android Marketplace, etc) you could always do an offline HTML5 app. Where the user goes to the webpage and it caches all the files that are required to run the app offline. This is a similar approach to what Google was doing with Google Voice when it was rejected from the iTunes store.

like image 135
Empereol Avatar answered Oct 18 '22 10:10

Empereol