View Full Version : Sencha Touch 2.x in UIWebview (IOS)/ WebView(Android)

22 Feb 2013, 7:52 AM
Many of the Sencha Touch components work great and I am a fan of their framework.
Taking into considering offline capability including app cache what do you think about loading a Sencha touch site hosted on a server but referenced from a uiwebview/webview?. The reason I want to do this is for using some of the native features which do not have a good flow when used with phonegap like OAuth..
Its easier to handle OAuth flow on a site hosted on a server(ex: Django) when compared to using phonegap and local JS(exposing OAuth secret keys) or that many OAuthProviders do not have a javascript api like facebook.
If there is a Sencha component provided to host a uiwebview then I would not have gone this route. There may be some compelling concerns and reaons from Sencha side not to offer this component.

What do you think about using Sencha Touch 2.x in UIWebview (IOS)/ WebView(Android)?
This discussion might me useful for other native app developers and can anyone give a feeback, additional info etc..

24 Feb 2013, 5:22 PM
I'm not really sure what you are asking here. If you are asking if it's a good idea, it's not a bad idea to do it, it's fine.

25 Feb 2013, 7:33 AM
Wanted to know if its a good idea to host sencha on backend cosnidering performance/expereience etc and if any customers have used it to display in UIWebView

25 Feb 2013, 7:41 AM
Apple may not like that approach, they have been hard on people before. FOr instance I have seen them turn down apps if they use no native features (like Camera).

25 Feb 2013, 8:01 AM
Thanks for the reply Mithchell.
I am thinking if I use a mobile framework to have a webversion and a native version. With native version I will to add something to webversioni.e hybrid with dynamic injection of native features like camera, barcode reader etc in local views...
Still evaluating how to go forward pure native or a mobile framework.
Thanks for your reply.

25 Feb 2013, 9:11 AM
One of Apple's guidelines is you can't download new code to the app. I think this would fit into that category as Mitchell suggested.

25 Feb 2013, 9:37 AM
shepsii: Thanks for your note
Does it mean we cannot use a website hosted on a server in uiwebview? as it usually downloads sencha and other clientside code?
And sorry I was not clear about dynamic injection. There would not be any changes on the web server based code, but user will see additional contacts icon on native version from where he can view contacts, see a camera icon from where he can access the camera etc.
The main reason to host some of the code on backend is to handle oAuth,session etc..

28 Feb 2013, 3:20 AM
Mmm you are probably on dubious ground! Probably down to the luck of the reviewer with this kind of thing. My major concern would be that the app wouldn't load without an internet connection at all. What if they downloaded the app, went offline and then opened it - how would they get your remote code then?

I'm not sure I'd go with that approach personally, but I have only put 2-3 apps through iTunes to date so I'm no expert. I have seen javascript oauth libraries though, might be worth taking a look at.