So, I'm using a "splash screen" for my Cordova iOS application. I'm actually using the "LaunchStoryBoard" image. My issue is that it seems to stay for a very long time before finally getting dismissed. A solid 3 seconds (as in 1 mississippi, etc.).
I've looked around on stackoverflow, but a lot of responses seem to be for the Ionic framework / Android. I'm not using that. Just straight Cordova with iOS.
Here is my config.xml:
<content src="index.html" />
<plugin name="cordova-plugin-whitelist" spec="1" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="DisallowOverscroll" value="true" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<splash src="res/screen/ios/Default#2x~universal~anyany.png" />
</platform>
And in my app's "General Settings" I have "Launch Screen File" set to CDVLaunchScreen.
Again, it works fine, just stays too long. It would be great to shave even 1 second off of it.
Also, if you have any custom javascript tips/help, please let me know what file it should be put into (e.g., index.js).
Thanks in advance.
Two ways to go about it.
You can try using cordova splash screen plugin and make use of SplashScreenDelay preference to set delay of your choice.
You can use the splash screen plugin, set the AutoHideSplashScreen preference to false and then you can use this code in onload of your index page to hide the splashscreen:
navigator.splashscreen.hide();
Related
i have an app build on vuejs and build with cordova. after i cordova build ios it successfully build the app but when i cordova emulate ios it is only showing app.vue components but not other components. the app.vue content is nav.vue. it only show the nav bar and make the other white screen. can someone please help me to solve this problem.
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<splash src="res/screen/ios/icon.png" />
</platform>
<access origin="about:*" />
<allow-navigation href="about:" />
<access origin="tel:" launch-external="yes" />
<access origin="mailto:" launch-external="yes" />
<preference name="scheme" value="app" />
this is my config.xml
Please try using the Safari Developer Tools on Mac to connect to your test device and check out the JavaScript console. Often times you will see the error there. On Android you can do this with Chrome.
I am answering my question. i solve this problem by just change the vue route history mode in to hash mode
like shown below
const router = new VueRouter({
mode: "hash",
base: process.env.BASE_URL,
routes,
});
and add the below code in vue.config.js file
devServer:{
https:false
}
We are running a Cordova App which works perfectly fine except for GET requests on IOS. In this scenario, the session cookies won't be transferred to the server. Usually, we use POST requests for our rest api calls. Exceptions are images which we load via GET requests. Therefore, authorized users won't be recognized as logged-in by the server when loading images.
Everything works perfectly when running the webapp oon the browser on the same device. Also, there are no problems on android. My guess is that because of the different http method, the webview chooses to not use the same cookies. This might be related to the cordova whitelist plugin which is now deprecated.
The cookie is being generated on the server on login.
Cordova/plugin versions:
"cordova-ios": "^6.2.0",
"cordova-plugin-splashscreen": "^6.0.0",
"cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-vibration": "^3.1.1",
"cordova-plugin-wkwebview-engine": "^1.2.2",
"cordova-plugin-wkwebview-file-xhr": "^3.0.0",
"ios": "^0.0.1"
Cordova ios preferences:
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="scheme" value="app" />
<preference name="hostname" value="localhost" />
<preference name="WKWebViewOnly" value="true" />
There are a few things you need to fix. Both these plugins are now obsolete with cordova-ios 6+
"cordova-plugin-wkwebview-engine": "^1.2.2",
"cordova-plugin-wkwebview-file-xhr": "^3.0.0"
This is also obsolete
<preference name="WKWebViewOnly" value="true" />
By default the webview is now WKwebview so you don't need the xhr plugin and the plugin you use is then also obsolete. Remove them and add instead
cordova-plugin-ios-xhr
Then go from there, hope this helps
I'm using these plugin on cordova#8.1.2:
<plugin name="cordova-plugin-device" spec="^1.1.6" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.2" />
<plugin name="cordova-plugin-wkwebview-engine" spec="^1.1.4" />
<plugin name="cordova-plugin-inappbrowser" spec="https://github.com/apache/cordova-plugin-inappbrowser" />
<plugin name="cordova-plugin-firebase"
spec="git+https://github.com/dpa99c/cordova-plugin-firebase.git#GH-1057-April-05-android-build-issue" />
<plugin name="cordova-plugin-network-information" spec="^2.0.1" />
<plugin name="cordova-plugin-androidx" spec="^1.0.2" />
<plugin name="cordova-plugin-androidx-adapter" spec="^1.0.2" />
I've tried many different guides, I'm using legacy Build, set the p8 key on firebase for APN and in Android FCM messaging works smoothie. On IoS I can receive it only when the app is in the foreground.
I think the problem is related to "Disconnected from FCM" string. I obtain this log whenever I close or I switch my App.
You are using my old fork of cordova-plugin-firebase (https://github.com/dpa99c/cordova-plugin-firebase.git#GH-1057-April-05-android-build-issue) which is only a partial fix for that plugin's multiple unresolved issues.
Please try using my fork of that plugin - cordova-plugin-firebasex - which resolves numerous issues with FCM notifications and adds new functionality.
Note: the latest version - cordova-plugin-firebasex#5.0.0 - contains breaking changes such that the API is no longer the same as cordova-plugin-firebase. If you decide to migrate, please read the documentation carefully.
Please see attached snippet I am using for inappbrowser. I have used '_blank' with location and toolbar=yes the link opens in the inappbrowser, but there is no back button or done button.
I have tried replacing '_blank' with '_self', but this doesn't make any difference.
Since this wasn't working for me, I decided it's best to open the link in the system browser and replaced '_self' with '_system', but this does not work. The link does not open at all.
All 3 run fine when i test it in the browser, but when simulating it on the iOS simulator or when testing on the iOS device, I face the above issues.
I have read a lot of posts on stack overflow and on the ionic forum and tried almost all solutions provided, but none have worked for me. It seems to be a bug in using ionic with iOS. Anyone have any other solutions?
〈a ng-href="https://facebook.com" target="_self" ng-click="cordova.InAppBrowser.open('https://facebook.com','_self', 'location=yes, toolbar=yes'); return false;"〉test〈/a〉
Ionic 1, Xcode Version 8.3.2, iOS 9, cordova-plugin-inappbrowser spec="^1.7.1"
I have checked in my previous app. code is working fine.
check this github repo for example code: https://github.com/varunaaruru/ionic1-inappbrowser
install the plugin :
ionic cordova plugin add cordova-plugin-inappbrowser
in html file :
<a href="#" onclick="window.open('http://www.facebook.com', '_system', 'location=yes'); return false;">
click here
</a>
you can use blank or self in place of system
This fixed the problem for me. Add the following code is in your config.xml file if it isn't already present:
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
Add the href depending on the hyperlink you are using in your project.
Add the below lines:
const iosoption: InAppBrowserOptions = {
zoom: 'no',
location:'yes',
toolbar:'yes',
clearcache: 'yes',
clearsessioncache: 'yes',
disallowoverscroll: 'yes',
enableViewportScale: 'yes'
}
if (this.platform.is('ios')) {
browser = this.inAppBrowser.create(this.ValidateUsers, '_blank', iosoption);
}
I have a phonegap application that is working perfectly through the local server on the phonegap development iOS app.
Specifically, a call to
var ref = cordova.InAppBrowser.open('https://subdomain.domain.com', '_blank', 'location=no');
works fine in the dev app, however when pushed to phonegap build and accessed via the app installed via testflight, using Hydration to update easily, the button is entirely unresponsive.
I have a feeling that none of the plugins are being loaded, as the status bar is malfunctioning as well.
Here is the relevant part of the config.xml file:
<plugin name="cordova-plugin-inappbrowser" spec="~1.7.0" />
<plugin name="cordova-plugin-statusbar" />
<plugin name="cordova-plugin-whitelist" spec="1.3.1" />
I know the insecurity of this, however, changing to the url i am trying to access does not change anything:
<allow-navigation href="*" />
<allow-intent href="*" />
<access origin="*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<allow-intent href="*" />
</platform>
The button in question:
<span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> OR SIGN UP
The javascript relating to this button:
document.addEventListener("deviceready", function(){
deviceReadyDependantFunctions();
initializeApplication();
});
function deviceReadyDependantFunctions(){
alert('initialised!');
$('#signUpButton').unbind().click(function(){
console.log('here');
var ref = cordova.InAppBrowser.open('https://subdomain.domain.com?some=variable', '_blank', 'location=no');
ref.addEventListener('loadstart', function(event) { alert(event.url); });
console.log(ref);
});
}
Obviously, there's a bunch of debugging in there....
The "initialised" alert fires in all environments.
The event.url alert fires in the dev app but not in the test flight, hydrated application.
I have been trying everything I can find to rectify this... The only solution I have found is to use a simple href="theUrl.com" and let the system browser load it. Which is not a solution at all... I need to load the url in the app. It's a sign up page and is essential that it can be accessed from the app.
Things I have tried:
Every permeation of whitelisting, although there are varying docs saying that in app browser is/isn't affected by the whitelist plugin.
Using a different version of phonegap (<preference name="phonegap-version" value="cli-6.5.0" />) to no avail.
Checked that the plugins are present in the phonegap build "plugins" tab. They are.
Tried replacing the reference to cordova.js with phonegap.js. This didn't work at all.
The order of loading js files (the above call to inappbrowser is in a seperate js file). No difference.
What am I doing wrong?!
Or is there something weird with the TestFlight/Hydrated Application combination?
You can see the ridiculous commits I have made, as well as the full codebase here:
https://github.com/andycharrington/yfa/commits/master
Any advice would be massively appreciated.
Thank you.
Recompiling the unchanged code with Phone Gap Build this morning seemed to magically fix it. Don't you just love it when that happens? :)