Is it possible to create a full screen web app on iphone/ipad without adding it to the home screen first? - iphone

I know I can use the apple-mobile-web-app-status-bar-style meta tag and after adding the web page to the home screen, it will run the app in full screen mode.
My question is if there is any tag, css or javascript I can use to tell mobile safari to do it directly, without having the user adding to the home screen first?

You could consider something like PhoneGap that deploys a webapp as a native iphone application. It would also allow you access to things like the accelerometer via javascript calls.

Currently, and sadly, this can't be done :(

There is a way of automatically installing 'webclips' on your idevice.
You do this by deploying a profile payload to your device (.mobileconfig file).
Payloads can be signed or unsigned, for testing purpose unsigned profiles will come up as Insecure.
https://developer.apple.com/library/ios/featuredarticles/iPhoneConfigurationProfileRef/Introduction/Introduction.html
The advantage using a profile like this is that you can set it so the user cannot remove the 'webclip' in the standard way, having to remove the profile to remove the app. You can also protect this with a PIN.
One reason I didn't use this method for registering my apps was that I couldn't get it working offline with appcache manifests (iOS6.x), however this may have improved since iOS7.x

Related

iOS - app containing another app

I would like to hand my application to another developer to assymilate in his iOS app.
The goal is to have, in his app, a shortcut that opens my app directly - not just a link to the appstore.
The problem is my app has to remain compiled, since I don't want to hand over my source-code.
Is this situation, of one compiled iOS app, encapsulated insind another iOS app, even possible?
Thanks in advance.
Your application can register a custom URL handler that will launch it whenever any application will follow that URL. It can be triggered from Safari but it can also be triggered from any other application.
Here's how you enable that feature in your app and handle incomming passed parameters etc.
All code in an app bundle has to be staticly linked, so you would have to rewrite and compile your app as a linkable shared library.
What you're looking to do really isn't possible. Each app has it's own code structure and can't be embedded into another app (MainWindow.xib for example). Each app is also signed by the developers private key, so that's an obstacle there. You can't just hand him a binary of your app.
What you could do is potentially take your .XIBs and view controllers and give them to him to implement. This is easiest if there's no model that also has to be migrated over. Then he can present your views to take advantage of the logic built into your view controllers.
It's not a trivial amount of work and of questionable value. If you're not willing to share source code then none of the above is really going to work for you.
My advice would be as people above have mentioned and use a URL scheme in his app that refers to yours. Yes, your app would need to be installed, but then there's a clear and unambiguous separation between his work and yours...

Jquerymobile HTML5 Iphone App Add to Home screen

I'm creating a Mobile App with JQM and JSP I'm using Bookmark bubble to do this, but I just want to ensure I understand what is happening behind the scenes here.
Is the static HTML generated by my JSP saved locally on the iPhone?
Does clicking on the APP always get fresh info from my online server or does it cache?
I'm assuming it still uses Safari to render? And just hides the toolbar etc?
If instead of hosting this online, I packaged it as an Apple App and it went on App store,
would the device still use safari to render it?
Thanks!
Documentation is at: https://developer.apple.com/library/content/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/OfflineApplicationCache/OfflineApplicationCache.html
It's possible to cache the page(s) locally.

Phonegap WEB-APP without xCode

I'm building a simple web app for iOS that will not be published to the AppStore.
For infrastructure limits (and my boss!) , I can't use xCode anyway to build the app in a native way.
The only NATIVE functionality required by the web app should be a simple "Add to contacts".
I've tried to implement it with phonegap , but it works only compiled under xCode.
Is there any way to "add to contacts" without building an app (using only a web-app )?
Thanks in advance
Andrea
I don't think there's a way for you to add a contact directly, using only a web app.
PhoneGap was made for this sort of thing, allowing you to access a device's features (like Contacts, Camera, GPS, etc). But if your company's project specifications don't allow for an app... I don't know that there's a way to do this directly, via the web.
If you're building a web app... while you may be targeting iPhones, you're still making it available to anyone with a browser. I'm not 100% on this, but having some way for a web page to directly manipulate a (Mac) user's contacts seems like a security issue.
As a test, I tried placing a vCard on a page, and accessing it via my iPhone. Changing the extension from .vcf to .vcard didn't yield anything (and for some weird reason it prompted me to open the file via Dropbox).
What did work was emailing myself the vcard as an attachment. I was able to view the attachment, which then gave me the option to add the info as a new contact.

Can UIWebView replace a Safari?

Can we build an Application using UIWebView that will entirely mimic the Safari Browser?
Are there any cases where UIWebview can not do what that can be done in Safari?
For one thing, you have a separate cookie storage per app. So if a user has some preferences at site X within Safari, it won't have those preferences at site X within your browser, and vice versa. Apart from that a UIWebView is very much like the real thing.
You cannot easily build an application that mimics the Safari browser using the public API exposed by UIWebView component. For one thing, please look at the UIWebView delegate methods. When you have frames inside the page you want to load, you may have a hard time telling if a user has clicked inside an iframe/frame or clicked on a link in the main document.
Dealing with authentication to site with invalid certificates is also hard with the UIWebView component, especially when the site with invalid certificate is reached by clicking a link inside an iframe.
Rendering content in UIWebView will be much slower than it is in Safari.
Safari's Javascript engine uses a "just in time" compiler. It takes the incoming Javascript code and transforms it on the fly into machine code that can run directly on the iOS device's ARM CPU. This allows Javascript code to run at a speed similar to a native app's code.
The problem is that Apple doesn't trust third-party developers with this power. If a third-party app had the power to convert Javascript into machine code and run it, that app would also have the power to download and run other pieces of machine codeā€”and Apple would never get the chance to review that code. Once App Review approved it, (developers/hackers) can change the downloaded code into something that logs your passwords or something. And there's no way to grant this power only to UIWebView and not to other parts of an app, because UIWebView runs in the same process as the developer's code.
So basically Apple forbids this because allowing it would break the security provided by the App Store and make iOS more vulnerable to attack. They can allow it for Safari because they control what Safari does, but they can't trust others not to abuse that ability.

Simplest way to incorporate iPhone file upload when building app with Appcelerator's Titanium Developer

Sorry for the long explanation. Thanks in advance to all who are taking their time.
I am an Ubuntu user who has set up Titanium Developer on a MacMini in order to build an app for the iPhone (and ultimately some other platforms).
Rather than having any local code built in, the app simply points to my website. To do that, all I needed to do was change Titanium's tiapp.xml file to include my website URL. I wrote no other code, nor did I need to include any other files. It simply compiled and ran in the emulator without a hitch.
I've got just one problem: I need to upload files to my website and Apple, as most of you know, has disabled the input field type=file. I've got it working in all other browsers. The action simply calls a php file and passes the file info.
If I didn't have an app, and someone was just manually navigating to my site with the iPhone's Safari browser, I could get around the problem by using CliqCliq, which is a very cool iPhone app. Basically, I use JavaScript window.open() to launch CliqCliq's QuickPic browser in a second Safari window. The user chooses a file; QuickPic uploads it; and the user is returned to the second Safari window that I launched with window.open(). The user closes the window and Safari returns them to the first window (i.e., my website).
The problem is that my website is being shown in my app. (By the way, I don't have my developer license yet, even though I signed up a few weeks ago, and I can't test this in the emulator because I can't install QuickPic into it, I assume.) I wanted to repeat the same steps, described in the previous paragraph, using an iFrame but that didn't seem to work (i.e., the iFrame was blank despite my designating a src). I also tried having a hidden window by using old-fashioned frames and setting the col-width to 0. That also did not work (i.e., Safari, if I recall correctly, opened a separate window).
I'm working a little blind, since I can't test anything on the iPhone, but I figure I have two options: I can either find a way to launch a QuickPic in an iFrame -or- I can find some way to incorporate the Apple toolkit file chooser into the Titanium app.
The problem with the first option -- but again, I don't know until I can try this on the iPhone -- is that I assume both apps (mine and CliqCliq's) could not run at the same time. Even if I had a hidden window, invisible iFrame, etc., the moment it launches QuickPic, I assume my app would quit(?).
The problem with the second option is that I don't have clue as to how to incorporate a file picker into my app by using Titanium (keeping in mind, everyone, that I know very little). Brian at CliqCliq has even offered to give me some code if I can't make Apple's file picker work but again, I'm not sure what to do next.
What do you folks think? What's the best method? And, what's the easiest thing for a simpleton to do?
Thanks.
<input type="file"> is not supported on the iPhone. You'll need to use Titanium's APIs, specifically the Media one (openPhotoGallery or showCamera).
As a side note, Apple reportedly rejects apps that are just a webview displaying a website. You may want to consider putting most of the app code in local storage and using AJAX to fetch content.