How can I make my web app iPhone 5 compatible? - ios

I have a website optimized as a web app with iOS safari, so that adding to home screen opens the app in a separate Webview. However, it always opens in the 3.5" letter boxed mode, instead of stretching to fill the screen. I know that with native apps, you just have to add the iPhone 5 sized launch image. How can I do this for a web app?

I found on this post that all that is required is that you remove width=device-width from the viewport meta tag. The blog talks about specifying a startup image, but this appears to be optional.
Edit: Original source of answer is Max Firtman. He indicates it may be a bug as well (see comments), but for now, this solution works.

Related

iOS Universal app seems slightly zoomed in on phone

I have an iPad app that I'm converting to a universal app to show on phones. It has both a tab bar and a navigation bar, and my problem is that they are both way too big on the phone. I could swear I heard Paul Hegarty (from the iTunes U class from Stanford on Swift app development) mention a switch or trick somewhere that would cause the bars to adapt to the iPhone, but I can't find it.
Here are screenshots of my apps bars, vs the Photos app in the iPhone 6 simulator to show what I'm talking about.
Not a huge difference, but significant on a small phone screen.
My fonts are also way to big, which is confusing since I have them set to the system "headline" or "body" options for all size classes, but that may be a separate issue.
Any help is greatly appreciated!
App written in Swift, using storyboards for iOS8, btw.
Edit:
The more I look at this, the more I'm convinced it's not related to the bars, but the entire app - the fonts and everything. The whole app appears to be zoomed in to 120%, which is subtle, but looks really bad and wastes space.
I have also now seen this in a second app - the Apple DateCell sample. It also appears 'zoomed in' when run on the iPhone 6 simulator.
Edit 2:
This effect is even more exaggerated on the iPhone 6 Plus simulator - everything is even more 'zoomed in' looking - the top and bottom bars are almost twice the height they should be. This can be seen by downloading the Apple DateCell sample and running it.
Edit 3:
ARGGGG, all this time wasted, and it was due to the launch screen image - why on earth would a launch screen image not being set cause the entire app to scale?
I finally figured this out - it was related to the launch screen image. Apparently if it's not setup right, the whole app scales on the iPhone 6 and 6 Plus for some reason. This question is what pointed me to the answer.
For me, I had to both create a LaunchScreen image in Assets, and set it in the project file, and ALSO select the launchScreen.xib as the Launch Screen File in the project. I don't have a real launch screen yet, so these are both just empty or defaults in my case.

Both iOS WebView types incorrectly setting 320px viewport size on iPhone 6 and 6+ (Xamarin app)

I've been wrestling with this for a few hours now. Here's the repro scenario (Xamarin.iOS 8.10, iOS 8.2):
Created a (mostly) empty test web page (no stylesheet, just a width=100% on the body) with the following tag: <meta name="viewport" content="width=device-width, initial-scale=1.0">
Page loaded in both a UIWebView and WKWebView (preferred) in a thin-client app designed for portrait mode on iPhone
Debug via iOS Simulator, attach to WebView instance in Safari on parent Mac
Viewport width always shows 320px when simulating both iPhone 6 and 6+, making the web page appear scaled too large
Same page loaded and debugged via mobile Safari
Viewport width shows 414px (6+) and 375px (6), as expected
I've experimented with SizeToFit() and ScalesPagesToFit on the WebViews and AutoresizingMask on the parent ViewController, but they don't seem to have any effect on the reported viewport size.
Does anyone have any idea why the WebViews have the wrong viewport dimensions? This is the prescribed approach everywhere I look. Is it an iOS issue, a Xamarin issue, or something I'm missing or potentially not doing correctly in code?
It turns out that the necessary launch images for the higher-res iPhones were present but not properly included in the iOS project, causing the app to load at the lower resolution of previous iPhones. Once Default-667h#2x.png and Default-736h#3x.png files were referenced, the app loaded as expected. Leave it to Apple to make their app runtime resolutions dependent upon something like the presence or absence of particular image files!
Use a storyboard for iOS9+. Less hassle having to deal with all those images too.
https://developer.xamarin.com/guides/ios/application_fundamentals/working_with_images/launch-screens/
NOTE: The information in this section is provided for historical reference only. Starting with iOS 9, Launch Screens should be created with Storyboards instead of including specific Image Asset Launch Screens for all of the different iOS Device types. Please see the Managing Launch Screens with Storyboards section below for details.

PDF being squeezed and losing aspect ratio in IOS 8 on Iphone

I have a website that allows users to view PDF documents. In mobile safari in iOS 8 I am having issues with landscape oriented PDF's being squeezed to fit the window. This pdf should have a landscape orientation (it looks like the browser is forcing it into portrait). The user is being directly linked to the pdf file they wish to view aka: http://whatever.com/anygivenpdf.pdf
Here is a screenshot of the issue in the IOS simulator (Iphone 5, IOS 8.1). I do not have this issue in IOS 7. Any thoughts on a fix or where the issue is originating from? I'm thinking it's either way the PDF's are saved or something must be fixed for the browser itself.
I regard this primarily as a Safari bug in iOS 8.
However, I have found a way to modify a PDF document to avoid this problem. My method works only on a Mac:
Open the existing PDF doc by the Preview app.
Select "Export as PDF..." from the File menu.
In the pop-up box where you select the new file name, click first on the button "Show details" in the lower left corner.
Select the icon for landscape orientation!
Give the document a new filename.
Click Save.
(I run a Swedish version of Mac OS X, so I am not 100% sure that I have used exactly the correct terms used in the menus of the English version, but I think you will find your way based on my description.)
Credits to these posts, putting me on the right track:
https://discussions.apple.com/thread/6540211
and
http://www.appligent.com/my-pdf-document-is-rotated-how-do-i-fix-that/
In the second one, you will find a specific description on how to fix the problem using Acrobat Distiller, if you happens to have that application installed. That should be a way forward if you run Windows, I believe.

Phonegap application getting crash when entered in background mode

I'm working on application in ios using PhoneGap(1.9).Following are the issue's i'm facing with quiet few hours...
1)My application is getting crash when application enters in background mode.
2)Also,how to disable splash screen.I have deleted default.png image,but still it is showing splash screen with phonegap logo followed by white blank screen.
Thanks & regards.
I came across this question because I'm having the same problem with background mode.
However, regarding splash screen, I can tell you that you have to replace the specific file for the screen size. It generates images for all of the screen sizes and you have to replace them in the built folder, not just the original project folder (at least I seem to have to do this).
The built folder is at the path that should look like /MyProject/platforms/ios/www/res/screen/ios/[screen_specific_splash_screens]
Similarly I had to do the same for the icons:
/MyProject/platforms/ios/www/res/icon/ios/[screen_specific_icons]
Docs for these files (talks about which screen sizes):
http://docs.phonegap.com/en/4.0.0/config_ref_images.md.html

Difference between launch image and splash screen

I was going through iOS Human Interface Guidelines.
It was mentioned as
Display a launch image that closely resembles the first screen of the application. This practice decrease the perceived launch time of your application.
Avoid displaying an About Window or a splash screen. In general, try to avoid providing any type of startup experience that prevents people from using your application immediately.
What is the difference between a launch image and a splash screen?
Launch image is the image that appears when you launch your app, the images you put in the xcode (iphone, iphone retina, ipad landscape, ipad landscape retina, ipad portrait and ipad portrait retina)
Apple recomends using a screenshot of your app main window, so it appears that your app launch faster (I use a screenshot without buttons)
Splass screen is, for example, the screens the games use, where you can see the company logo and some other info, some of them even use 2 or 3 splass screens. You have to include them programmatically
Wow, old question with no accepted or highly-upvoted answer, bubbling to the front page thanks to an edit. Guess I may as well try my hand at clearing things up?
Launch Image (or Launch Screen)
This is displayed by the OS itself, and appears only while the OS is loading your app (that is, before your process is running and any of your own code gets a chance to execute.
Because your app has no running code to handle display of the launch image, the way you provide one is part of your Xcode project's build-time configuration: Either you provide a LaunchScreen.storyboard, or a set of static launch images — one for each device screen size you support.
Apple's Human Interface Guidelines recommend that your launch image be a rough facsimile of the initial UI of your app. There are a couple of reasons for that:
The launch screen is displayed only briefly before your app takes over and can display its own UI, so having the launch image look like the actual UI makes the user feel more like they're jumping right into your app instead of having to wait for something else.
The launch screen is displayed only briefly, so if you display something that doesn't look like your initial UI, the user may see it flash and go away before they can get a decent look at it.
(Because your launch screen should look like actual UI, and because there are many screen sizes to support, the storyboard approach is preferred — you can use Auto Layout to ensure that your fake UI adapts to different screen sizes just like your real UI would. Xcode then generates the necessary images at build time.)
Splash Screen or About Window
This is what you see in many apps that don't follow Apple's guidance, and it comes in two forms (used separately or together):
Using the Launch Screen system to display content that doesn't look like the app's initial UI — instead, for example, it might be a logo or some other branding element, or might include static text like copyright notices, credits, or version information.
After the app has launched (and thus has control of the screen to display whatever it wants), continuing to display logos or branding or other passive content instead of a usable UI.
The second case is recommended against, but sometimes unavoidable — game engines, in particular, tend to take awhile to start up, so it might be okay to have a "loading" screen. (If so, your launch image should look like your loading screen, so that the user doesn't feel like they're separately waiting for your app to launch and then load.)
The worst offenders are apps that don't really have any extra "loading" work to do, but use a splash screen as their launch image, and then programmatically continue to display that image for an arbitrary amount of time so that the user gets more chance to see it. (And has to wait for it to get out of the way, or manually dismiss it, before actually using the app.)
Launch Image is displayed when the app loads.
Splash screen means, that you display a view with about information as your startscreen. Your User should use your app immediately.
The launch image is designed to make the perceived launch time of you app feel faster by showing something resembling the interface that will be loaded as quickly as possible. Displaying a logo does nothing but draw attention to how quickly your app loads and adds nothing to the user’s experience.
If your bundle have default.png then apps takes as a launch image and it remains on screen for 3 seconds
In iOS splash screen means when you provide any image named Default.png in the bundle and before executing the mainWindow it is just loading that image in the iPhone screen. So, Default.png image is considered as the Splash Screen in iPhone.
While you load the mainWindow in the iPhone application, you can assign any image that can be viewed in the screen in the specific size as given that is called the launch image.
So, launch image that is one which we provide run time when application launches and starting the main-window. And here launch image can be dynamically changed based on program written while Default.png / splash screen will be fixed for the application.
Please let me know if you still have any question?
Launch Image may take a little short time. It shows when app loading starts into iphone volatile memory. it shows for very short.
Splash screen means, that you display an Image until your necessary information loading not complete. Like, U can see any loading image before start any heavy game. When all data loading complete then this screen removed and game statrs.
It may shows for little long. !
Launch Image is displayed when the app loads. It is designed to make your app feel faster by showing something resembling the interface that will be loaded as quickly as possible.
Splash screen means, that you display a view with about information as your start screen. Your User should use your app immediately.

Resources