WKWebView instead of UIWebView - Ionic - ionic-framework

New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability.
This is the issue I am facing when developed the App in IONIC and trying to upload the app to appstore.

Add plugin cordova-plugin-wkwebview-engine, preferably the latest version
Make sure you have this in your config.xml and
<platform name="ios">
<preference name="WKWebViewOnly" value="true" />
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
</platform>

Related

Phonegap Build Facebook Login

I have in an app for Android/iOS with a plugin "com.phonegap.plugins.facebookconnect" to login with Facebook. It's not working anymore so I thought I should have to change it for another one, anyway it won't compile anymore case Phonegape Build has got rid of their Repository.
Problem is that any plugin I try that is in https://cordova.apache.org/plugins/ ... Throw the same error message when trying to compile:
Error - One of your plugins requires a parameter - You can fix this
here
I tried:
cordova-plugin-facebook
cordova-plugin-facebook4
xenious-cordova-plugin-facebook4
cordova-plugin-facebook-account-kit
etc ..
And I defined them in config.xml in all different ways possible:
<plugin name="plugin-name" source="npm" >
<param name="APP_ID" value="123456" />
<param name="APP_NAME " value="name" />
<plugin>
<plugin name="plugin-name" source="npm" >
<params>
<param name="APP_ID" value="123456" />
<param name="APP_NAME " value="name" />
</params>
<plugin>
<plugin name="plugin-name" source="npm" >
<variable name="APP_ID" value="123456" />
<variable name="APP_NAME " value="name" />
<plugin>
APP_ID for some of the plugins is FACEBOOK_APP_ID and another one has one more value: AK_TOKEN. Just put examples of how I define them in config.xml
Funny is that if I don't put anything just the plugin without parameters, the message is different:
Error - One of your plugins requires a parameter: APP_ID, APP_NAME,
AK_TOKEN - You can fix this here
I made a new "Hello world" app without any plugin but this one and it is the same. I'm running out of ideas. Do I have to define those parameters somewhere else? Didn't use to be that way with the previous plugin I had. Any help?
You must set the parameters as follows:
<plugin name="cordova-plugin-facebook4">
<params>
<param name="APP_ID" value="XXXXXXX" />
<param name="APP_NAME" value="XXXXXXX" />
</params>
</plugin>
preference set in config.xml
<preference name="android-minSdkVersion" value="15" />
hope this helps.
I could finally make it work.
<plugin name="cordova-plugin-facebook4" source="npm" spec="1.7.4">
<param name="APP_ID" value="XXXXXXX" />
<param name="APP_NAME" value="XXXXXXXX" />
</plugin>
The difference was the spec"1.7.4" ...
After that, the build sent me a message that I had to define the android-minSdkVersion at the minimum necessary for the plugin, by default 14 if not stated. So placed this line also in config.xml
<preference name="android-minSdkVersion" value="15" />

ionic 2 blank screen error (sometime black/white) along with Application Error on Android

Getting this error:
Displayed splash.
Displayed black/White Screen.
Application Error!
"ionic info" output..
Working Solution:
adding these to config.xml
<preference name="loadUrlTimeoutValue" value="60000" />
<preference name="AutoHideSplashScreen" value="false" />

Ionic Splashscreen - How to remove fade?

I have the cordova splashscreen plugin working in my ionic project - except that I don't want the spashscreen to fade in. I've got the following in my config file but it doesn't seem to make any difference:
<preference name="SplashScreen" value="screen"/>
<preference name="SplashScreenDelay" value="1000" />
<preference name="SplashMaintainAspectRatio" value="false" />
<preference name="SplashShowOnlyFirstTime" value="true" />
<preference name="FadeSplashScreen" value="false"/>
<preference name="FadeSplashScreenDuration" value="0"/>
The splash screen still fades in for 3 seconds. What am I missing?
I'm using Cordova version 5.4.1 and version 3.2.2 of the splashscreen plugin.
<preference name="SplashScreenDelay" value="6000"/>
Add this in your config.xml. and adjust its value as required.
Earlier you were setting value of FadeSplashScreen to false , which was good because you did not want your splashscreen to fade in.But that was also the reason why any changes in your FadeSplashScreenDuration was not working.

Splash screen in ionic framework cordova not working

This is my code
angular.module('starter.controllers', ['ngCordova'])
.run(function ($ionicPlatform) {
$ionicPlatform.ready(function () {
setTimeout(function () {
navigator.splashscreen.hide();
}, 500);
});
})
Are you trying to hide the splash screen? If you are, why not set up your splash to be a blank image? Find a high res blank png and run the command ionic resources --splash and this will generate your splash image for all the devices.
Have a look a Cordova's documentation or the documentation on npm repository: you might need to set some preferences in config.xml.
First, the following is not mentioned on the first site but it might solve your problem:
<preference name="SplashScreen" value="screen" />
Maybe you could also have to change some settings such as disabling autohide (you already hide the splash screen manually when you hide your app so it shouldn't be a problem) :
<preference name="AutoHideSplashScreen" value="false" />
Note :
As Joseph Ocasio already mentioned, don't forget either to generate your resources with the Ionic CLI.
To generate all (application icons + splash screen images) :
ionic resources
To generate splash screen images only :
ionic resources --splash
Be sure that you have got already installed the plugin cordova-splash-screen (cordova plugin add cordova-plugin-splashscreen --save)
Then check you config.xml file and add this
<preference name="FadeSplashScreen" value="true" />
<preference name="FadeSplashScreenDuration" value="1000" />
<preference name="Fullscreen" value="false" />
It should be work :)

Ionic Facebook authentication - CORS request rejected

I am running ionic using Visual Studio Android emulator and trying to authenticate a user through facebook using -
Ionic.Auth.login(authProvider, authSettings, loginDetails)
.then($scope.authSuccess, $scope.authFailure);
The call fails with the message in the message: “CORS request rejected: https://api.ionic.io/auth/login/facebook”. Anyone had this problem or know how to resolve it?
Install cordova-plugin-whitelist in your project, and add one of the follow in config.xml
<!-- Allow links to example.com -->
<allow-navigation href="http://example.com/*" />
<!-- Wildcards are allowed for the protocol, as a prefix to the host, or as a suffix to the path -->
<allow-navigation href="*://*.example.com/*" />
<!-- A wildcard can be used to whitelist the entire network, over HTTP and HTTPS. *NOT RECOMMENDED* -->
<allow-navigation href="*" />
<!-- The above is equivalent to these three declarations -->
<allow-navigation href="http://*/*" />
<allow-navigation href="https://*/*" />
<allow-navigation href="data:*" />