why is the whole screen zooming-in on iOS app? - ios

I'm working on an iOS (8 and 9) app. I'm using phonegap build to pack everything up and phonegap desktop along with phonegap developer app to do some tests. My UI is already designed and everything looks fine when using the phonegap developer app as well as in mobile safari, but when i port it to my device, the UI looks blurry, including font, borders, divs, even, the status bar and keyboard.
Here's the correct view, using Phonegap app and mobile safari:
Good
And Here's the actual view when installed.:
Bad quality
I have set the viewport and scales but they do not affect the status bar nor the keyboard.
Here's my XML
<preference name="phonegap-version" value="3.7.0" />
<preference name="orientation" value="default" />
<platform name="ios">
<preference name="Orientation" value="all" />
</platform>
<preference name="fullscreen" value="true" />
<preference name="target-device" value="universal" />
<preference name="webviewbounce" value="true" />
<preference name="prerendered-icon" value="true" />
<preference name="stay-in-webview" value="true" />
<preference name="ios-statusbarstyle" value="lightcontent" />
<preference name="android-windowSoftInputMode" value="adjustPan" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="detect-data-types" value="true" />
<preference name="exit-on-suspend" value="false" />
<preference name="show-splash-screen-spinner" value="false" />
<preference name="auto-hide-splash-screen" value="false" />
<preference name="SplashScreenDelay" value="5000" />
<preference name="EnableViewportScale" value="true" />
<preference name="TopActivityIndicator" value="gray" />
<preference name="KeyboardDisplayRequiresUserAction" value="false" />
<preference name="HideKeyboardFormAccessoryBar" value="true" />
<preference name="SuppressesIncrementalRendering" value="true" />
<preference name="android-minSdkVersion" value="18" />
<preference name="android-installLocation" value="internalOnly" />
<preference name="ErrorUrl" value="" />
<preference name="BackgroundColor" value="0x000000" />
<preference name="KeepRunning" value="true" />
<preference name="DisallowOverscroll" value="true" />
<preference name="LoadingDialog" value="" />
<preference name="LoadUrlTimeoutValue" value="20000" />
<preference name="disable-cursor" value="true" />
<gap:config-file platform="ios" parent="UIViewControllerBasedStatusBarAppearance" overwrite="true">
<false/>
</gap:config-file>
<content src="index.html" />
<gap:platform name="ios" />
<gap:platform name="android" />
I have to mention that using a newer version of CLI does not solve the issue.
Here's my meta tag
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
Phonegap desktop's example app is also showing this behaviour.
Do you have any ideas of what may be happening?

I Found the issue. It turns out that, since iOS 9, the splashscreen requirements changed. So, when the .ipa was created, there were some files missing (The splashscreen for iPhone 6 and 6+).
Adding the next xml code to my config.xml
<gap:splash src="Splash/Default-667h#2x.png" gap:platform="ios" width="750" height="1334" />
<gap:splash src="Splash/Default-Portrait-736h#3x.png" gap:platform="ios" width="1242" height="2208" />
<gap:splash src="Splash/Default-Landscape-736h#3x.png" gap:platform="ios" width="2208" height="1242" />
and the corresponding files made the trick.
Now the view seems really sharp.
Hope this helps someone.

Related

PhoneGap doesn't show iOS build

I'm developing a hybrid mobile app using PhoneGap as a build tool.
Enviroment:
Visual Studio 2015
DevExteme library
PhoneGap cli version 8.0.0
Cordova iOS version 5.0.0
Plugin added: Cordova Support Google Services and Cordova Plugin Firebase Analytics
Development certificate for iOS unlocked on my PhoneGap account
Steps:
Build a PhoneGap Zip.
Upload the code on PhoneGap account.
Build the app.
The problem: PhoneGap doesn't show iOS build, but only Android (which works perfectly on device)
What am I doing wrong?
Thank you in advance,
Sara
Edit: 2019-03-07
As requested, I add config.xml.
<widget id="com.devexpress.apptemplate" version="1.0" versionCode="1">
<name>ApplicationTemplate</name>
<description>Template</description>
<author email="email#sample.com" href="http://sample.com">Author</author>
<preference name="permissions" value="none" />
<preference name="prerendered-icon" value="true" />
<preference name="android-windowSoftInputMode" value="adjustResize" />
<preference name="SplashScreen" value="splash" />
<preference name="SplashScreenDelay" value="60000" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="FadeSplashScreen" value="false" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="StatusBarBackgroundColor" value="#000000" />
<preference name="android-minSdkVersion" value="14" />
<preference name="android-targetSdkVersion" value="22" />
<preference name="cordova-ios" version="5.0.0" />
<preference name="phonegap-version" value="cli-8.0.0" />
<plugin name="cordova-plugin-splashscreen" onload="true" />
<plugin name="cordova-plugin-whitelist" />
<plugin name="cordova-plugin-ios-longpress-fix" />
<plugin name="cordova-plugin-statusbar" onload="true" />
<access origin="*" />
<plugin name="cordova-plugin-inappbrowser" source="npm"></plugin>
<platform name="ios">
<resource-file src="GoogleService-Info.plist" />
</platform>
<plugin name ="cordova-support-google-services" />
<plugin name ="cordova-plugin-firebase-analytics" />
</widget>

iOS Status bar overlay and PhoneGap build

I'm trying to make this config work with PhoneGap build server:
<gap:plugin name="com.phonegap.plugin.statusbar" version="1.1.0" />
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="StatusBarBackgroundColor" value="#7fbfd3" />
<preference name="StatusBarStyle" value="lightcontent" />
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true" />
</feature>
It works fine when I use cordova build but no luck with PhoneGap build server for now. Plugin is vailable from JS, color is applied but there is no additional space for status bar. I've tried both org.apache.cordova.statusbar and com.phonegap.plugin.statusbar. Any ideas how to make it work with PhoneGap build server?
Here is rest of installed plugins and preferences set
<preference name="permissions" value="none" />
<preference name="phonegap-version" value="3.7.0" />
<preference name="orientation" value="portrait" />
<preference name="target-device" value="universal" />
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="true" />
<preference name="prerendered-icon" value="true" />
<preference name="stay-in-webview" value="false" />
<preference name="detect-data-types" value="true" />
<preference name="exit-on-suspend" value="false" />
<preference name="show-splash-screen-spinner" value="false" />
<preference name="disable-cursor" value="false" />
<preference name="android-minSdkVersion" value="19" />
<preference name="deployment-target" value="7.0" />
<preference name="android-installLocation" value="auto" />
<preference name="webviewbounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<gap:plugin name="org.apache.cordova.console" />
<gap:plugin name="org.apache.cordova.inappbrowser" />
<gap:plugin name="com.ququplay.websocket.websocket" version="0.1.0" />
<gap:plugin name="org.apache.cordova.device" />
<gap:plugin name="com.telerik.plugins.wkwebview" />
It won't work with Hydration if you're using that; otherwise it should, but not all preferences...
I've shared a similar issue to PGB support today. Here my ticket:
The plugin cordova-plugin-statusbar not works correctly on PGB.
<gap:plugin name="cordova-plugin-statusbar" source="npm" />
Some configuration preferences are not considered on build. I've setted on config.xml following common preferences:
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="StatusBarBackgroundColor" value="#0ff000" />
<preference name="StatusBarStyle" value="default" />
I've tested on phonegap CLI, it works fine.
On PGB the iOS StatusBar overlays the webview. But if I turn off the overlays programmatically using the plugin's API, it works fine, and I can see the green StatusBar as setted on preferences,... but not the style default (dark text) also setted on preferences.
I've also tested the previous plugin source but it raises same results:
<gap:plugin name="org.apache.cordova.statusbar" source="pgb" />
I've created an App HelloWorld only for that purpose: 1493471
FYI, I've also tested the deprecated Plugin com.phonegap.plugin.statusbar, it considers the StatusBarOverlaysWebView preference but not the others...
I was dealing with the same issue and i found out that WKWebView has some bugs with position css styling. Using de the default Webview will solve your overlay problem.
However, Im still trying to find a solution that works with WKWebView.

cordova[phonegap] Setting splash screen is not working fine in ios

I have added splash screen for my phonegap app.
I am building phonegap app online at http://build.phonegap.com.
Splash Screen is working fine for android.But on ios splash screen hides before the defined time.
Config.xml For Splash Screen
<?xml version="1.0" encoding="UTF-8" ?>
<widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
xmlns:android = "http://schemas.android.com/apk/res/android"
id = "com.clerisy.arcade"
versionCode = "10"
version = "1.0.0" >
<!-- versionCode is optional and Android only -->
<name>xxxxxxxxxxxxx</name>
<description>
xxxxxxxxxxxxxxxxx
</description>
<author href="https://build.phonegap.com" email="support#phonegap.com">
xxxxxxxxxxxxxxxx
</author>
<preference name="permissions" value="none"/>
<preference name="phonegap-version" value="3.6.3" />
<preference name="orientation" value="default" />
<preference name="target-device" value="universal" />
<preference name="fullscreen" value="false" />
<preference name="webviewbounce" value="true" />
<preference name="prerendered-icon" value="true" />
<preference name="stay-in-webview" value="false" />
<preference name="ios-statusbarstyle" value="black-opaque" />
<preference name="detect-data-types" value="true" />
<preference name="exit-on-suspend" value="false" />
<preference name="show-splash-screen-spinner" value="true" />
<preference name="auto-hide-splash-screen" value="true" />
<preference name="disable-cursor" value="false" />
<preference name="android-minSdkVersion" value="7" />
<preference name="android-installLocation" value="auto" />
<preference name="backgroundColor" value="0xff38c0f4"/>
<preference name="AutoHideSplashScreen" value="false" />
<preference name="ShowSplashScreenSpinner" value="false" />
<!-- Plugins -->
<!-- Core plugins -->
<gap:plugin name="org.apache.cordova.inappbrowser" version="0.5.2" />
<gap:plugin name="org.apache.cordova.network-information" version="0.2.12" />
<gap:plugin name="nl.x-services.plugins.socialsharing" version="4.3.8" />
<gap:plugin name="org.apache.cordova.device" version="0.2.12" />
<gap:plugin name="com.phonegap.plugin.statusbar" version="1.1.0" />
<gap:plugin name="org.apache.cordova.splashscreen" />
<!-- Set Icon and splash screen -->
<icon src="icon.png" platform="android" width="57" height="57" density="mdpi" />
<gap:splash src="screen.png"/>
<gap:config-file platform="ios" parent="CFBundleShortVersionString">
<string>100</string>
</gap:config-file>
<content src="index.html" />
<access origin="*" />
</widget>
to hide splashscreen i am using
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
// Hide splash Screen
setTimeout(function() {
navigator.splashscreen.hide();
}, 2000);
The Problem is :-
it is working fine on android but on iphone it changes the resolution of splashscreen after few seconds.
Install the splash screen plugin
cordova plugin add org.apache.cordova.splashscreen
For iOS you have to hide splash screen inside timeout function in document ready, you can define the duration after which the splashscreen should hide.
setTimeout(function() {
navigator.splashscreen.hide();
}, 8000);
set autohide splash to false in config.xml
<preference name="AutoHideSplashScreen" value="false" />
Refer the plugin documentation for more detail https://github.com/apache/cordova-plugin-splashscreen/blob/master/doc/index.md
If you have apple device build uisng Xcode and add sleep in main thread of app (in app delegate) and you are done with it

StatusBar preferences not working: phonegap version 3.6.3

I have a problem with the StatusBar in iOS. My app ID is 234560, StatusBar version "0.1.4" as suggested (here) and phonegap version 3.6.3. I have granted the permissions (CDVStatusBar) and the preferences (StatusBarOverlaysWebView false, StatusBarBackgroundColor A7A7A7 and StatusBarStyle lightcontent) with no sucess. My bar still appears as if StatusBarOverlaysWebView would be set to true and the background color is also not applied. This is how the relevant preferences are set in my config.xml:
<preference name="phonegap-version" value="3.6.3" />
<preference name="orientation" value="both" />
<preference name="target-device" value="universal" />
<preference name="fullscreen" value="false" />
<preference name="webviewbounce" value="false" />
<preference name="stay-in-webview" value="true" />
<preference name="show-splash-screen-spinner" value="true" />
<gap:plugin name="org.apache.cordova.statusbar" version="0.1.4" />
<preference name="permissions" value="none" />
<feature name="Device">
<param name="ios-package" value="CDVDevice" />
</feature>
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true" />
</feature>
<preference name="StatusBarOverlaysWebView" value="false"/>
<preference name="StatusBarBackgroundColor" value="#A7A7A7"/>
<preference name="StatusBarStyle" value="lightcontent" />
I would love to have any assistance, I have been reading a lot of issues regarding to this topic but non of them were ussing this phonegap version. Thank you in advance!
I had the same problem, then I decided to remove the plugin and then add it again, it worked!!
The github site for the plugin says this which worked for me:
iOS Quirks:
Starting with iOS 11 you must include viewport-fit=cover in your index.html viewport meta tag if you want the status bar to overlay the webview:
<meta name="viewport" content="initial-scale=1, width=device-width, **viewport-fit=cover**">

Icon is not displaying in iOS app build

I have created an config.xml file with following preferences for app,then i build the app using phonegap build. In iOS 6 and iOS 7 icon is not showing what mentioned in config.
Here is my config code
<preference name="phonegap-version" value="2.9.0" />
<preference name="orientation" value="portrait" />
<preference name="target-device" value="ios" />
<preference name="prerendered-icon" value="true" />
<preference name="fullscreen" value="false" />
<preference name="webviewbounce" value="true" />
<preference name="stay-in-webview" value="false" />
<preference name="ios-statusbarstyle" value="black-opaque" />
<preference name="detect-data-types" value="true" />
<preference name="exit-on-suspend" value="false" />
<preference name="show-splash-screen-spinner" value="true" />
<preference name="auto-hide-splash-screen" value="false" />
<icon src="assets/img/icon/ios/icon-60.png" gap:platform="ios" width="60" height="60" />
<icon src="assets/img/icon/ios/icon-60#2x.png" gap:platform="ios" width="120" height="120" />
Can any one give me any solution for this issue.
You need to setup here using xcode.

Resources