inject programming code into iphone app - iphone

I saw in this article you can run some javascript in a UIWebView:
http://iphoneincubator.com/blog/windows-views/how-to-inject-javascript-functions-into-a-uiwebview
It would be great if I could inject some business logic into my app based on a few parameters I have or be able to customize it on the fly via the web by downloading updated code that would become part of the app.
has anyone done this or is this even a possibility?

I would advise you to avoid doing it. Any app that downloads code will get rejected on the App Store.
From the App Store Review Guidelines:
2.7 Apps that download code in any way or form will be rejected

Related

Iphone application using webview

I've created a web application using asp.net. I customized it form mobile(jQuery Mobile) .
I created an iphone application that has a web view that shows the website.
Is this will be applied by Apple to publish this application???
Regards,
Moayyad
If the only purpose of the app is showing the webview with the website, and it does absolutely nothing else, then it will most likely be rejected. However, if showing the website is just a small part of its functionality, and it does some other useful things as well, then using a webview for displaying your own website is OK, as far as I know.
Note, however, that I/we can only make assumptions and guesses. Nobody except Apple knows what exactly will happen to your app - there are numerous cases when an app was rejected for a feature which another approved app had, so there are inconsistencies in the AppStore approval policy of Apple. Don't expect anything.
I don't think so. They prefer use of HTML5 in webapp. Try to review the Apple guidelines for building web app.

"Legality" of using web resources and appcache inside UIWebView/Phonegap

We are trying to develop a hybrid app that can update itself by using css/javascript/html from the internet, instead of storing them in the phonegap project.
Like so
Html5 cache manifest in a UIWebView?
HTML5 AppCache in UIWebView
It now does work fine on iOS 5 and 5.1
In fact, inside phonegap index.html we do or location.href redirect to the web site. The web site has offline manifest, which allows the phonegap app to start and work the second time in an offline mode (after all resources were cached the first time). And changes to manifest do update the app correctly. I have tried terminating the app in the phone, and restarting it while the web site is down - it still works.
There are solutions that allow self update - for example the phonegap-based Worklight. So silent self-update doesn't seem to be an issue anymore.
So the question is, did anybody submit similar an app to appstore? There's potentially no code at all in the app, all it does is goes to the web site.
Apple appears to allow apps to download data updates and Javascript/HTML for use in UIWebViews. They even presented a WWDC session on data driven apps a couple years back.
But note this item in Apple's app review guidelines:
2.12 Apps that are ... simply web sites bundled as apps ... may be rejected.
The only way to know for sure if your app is acceptable is to submit it to Apple for review, as "similar" apps do not appear to set any precedent for any future approvals.

Download additioanal functionality into an app - is it possible?

I'm currently developing an iPhone version of existing Android application.
Customer wants to provide his web services via mobile apps. On Android this is made in a modular way: user installs main app, and then he can download additional modules to it if needed. That way he can install only modules that he needs.
Is there a way to achieve same functionality on iPhone? I read about In-App Purchasing, but I don't know if it will work because additional functionality will not be built-in and unlocked - it needs to be downloaded and added to my app as a new module - so user's space would not be wasted with unneeded modules.
Thank you!
2.7 Apps that download code in any way or form will be rejected
From App Store Review Guidelines
Judging by the question, this is not a world-facing app - it has a specific customer. With Terente's answer in mind, do consider side-loading, AKA in-house distribution. That is - bypass the app store. The prohibition on the downloadable code is an App Store policy, not a limitation of the platform.
The enterprise contract with Apple is $300/year instead of regular $100/year. But you get to install your app on as many devices as you wish, completely bypassing the App Store. Either over the air (by browsing from the phone) or via iTunes.
Under this model, your app can download, store and run custom code all you want. The specifics of the plug-in model are up for you and your customer.
EDIT: so app store is a must. How about this: have a WebView in the project, have it download HTML pages with JavaScript in them, have code hooks for JavaScript to call. To the best of my knowledge, AppStore does not reject apps that display Web pages from the Net, and if the Web page happens to have a script, there's no prohibition on executing that script.
This violates the spirit of the rule while relying on letter and precedent. Technically speaking, JavaScript IS code. And again, technically speaking, WebView is capable of downloading and running it. And App Store is choke full of apps with WebView in them.
How will this fly with your customers, who knows.

Using another one application in one Iphone Application?

anytutorial to use good reader application in iphone sdk?
can I use Good reader application in my Iphone APplication?
To launch another application you have to find out if they have published a protocol to use and then 'open' that URL. See example, but not sure if GoodReader has published a protocol or how to find out if they have. You could always contact the developer directly.
You can't access another applications Sandbox or start another application via code, otherwise Apple will reject the app. I stand corrected to the answer about URL schemes to launch another app. You learn something new everyday.
You [can also] build the PDF functionality into your own app (i.e. use a UIWebView to do that for you).

updating iPhone apps via the web

I'm working on an eBook app for the iPhone. Given the time it takes for Apple to review and publish updates, I'm considering adding a feature to update the content via my own (Google App Engine-powered) web site.
This would allow me to update the content at will, rather than being at the mercy of the App Store review team. Is Apple likely to reject this kind of behavior in an app? I've asked in the Apple Developer forums, but received no response.
We have developed an application on the App Store that will go our web server and get new content when new content is available and store it on the iPhone. You should not have any problem as long as the content is not offensive. This could lead to your application being removed from the app Store. I've also heard that they may make your app 17+ because of getting content from the web.
You probably received no response because no one knows for sure. Apple has allowed apps that embed webkit before, but it has also rejected them as well.
iphone + web hybrid apps perfectly ok i think, not sure why apple would be concerned.