Allow-navigation on iOS - ios

I have a cordova app for Android and iOS. The app is a mobile website that loads in the webview. When a user clicks a link, that is outside the mobile website, I want the link opened in the system browser.
Now on Android this works fine with allow-navigation. iOS it's not.
<allow-navigation href="https://mywebsite.nl/*" />
<allow-navigation href="https://code.jquery.com/*" />
<allow-navigation href="https://fonts.googleapis.com/*" />
<allow-navigation href="https://use.fontawesome.com/*" />
<allow-navigation href="*.google.com" />
<allow-navigation href="*.googleapis.com" />
<allow-navigation href="*.gstatic.com" />
<allow-navigation href="*.googleusercontent.com" />
<allow-navigation href="google.com/*" />
<allow-navigation href="googleapis.com/*" />
<allow-navigation href="gstatic.com/*" />
<allow-navigation href="googleusercontent.com/*" />
<preference name="AllowInlineMediaPlayback" value="true" />
<preference name="MediaPlaybackRequiresUserAction" value="false" />
<allow-navigation href="*youtube*" />
<allow-navigation href="*ytimg*" />
<allow-navigation href="*youtube-nocookie*" />
<allow-navigation href="*vimeo*" />
<access origin="https://*.youtube-nocookie.com" />
<access origin="https://*.youtube.com" />
<access origin="*.vimeo.com" />
<access origin="*.vimeocdn.com" />
<access origin="https://*.ytimg.com" />
<access origin="https://*.gstatic.com" />
<access origin="https://*.googlevideo.com" />
<access origin="https://*.google.com" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
Do I need to add something for iOS to open the system browser when clicking an external link?

Related

How to load sub index.html page to localhost in cordova ios

I am working on an ios project with cordova wkwebkit.
Of course, I know that cordova recommends spa.
In the case of the main index.html file, the page was opened on localhost as shown below in config.xml.
<content src="index.html" />
<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="ios">
<preference name="scheme" value="app" />
<preference name="hostname" value="localhost" />
</platform>
Then you can see that the result of checking in Chrome developer mode is applied successfully.
enter image description here
But in the case of the sub index.html file, I don't know how to load it on localhost.
solution is required.
Currently, we are loading the sub index.html file with the file protocol.
enter image description here
file path:
(main) index.html path : www/index.html
(sub) index.html path : www/world/wikitude_AR/inedex.html
version:
cordova - 11
cordova ios - 6.2

Getting blank screen in IPA after updating angular cordova-ios platform

Initially we were using angular cordova-ios version as 4.5.4 and while uploading the IPA to Apple Store Connect it gave UIWebView error hence, upgraded the cordova-ios platform to 5.1.1 and added cordova-plugin-wkwebview-engine plugin. Now on generating IPA , it shows blank screen and doesn't route to the login screen.
Version details are as below:
angular-devkit/architect 0.10.7
#angular-devkit/build-angular 0.10.7
#angular-devkit/build-optimizer 0.10.7
#angular-devkit/build-webpack 0.10.7
#angular-devkit/core 7.0.7
#angular-devkit/schematics 0.8.9
#angular/cli 6.2.9
#ngtools/webpack 7.0.7
#schematics/angular 0.8.9
#schematics/update 0.8.9
rxjs 5.5.12
typescript 2.9.2
webpack 4.19.1
cordova-ios 5.1.1
We used the below command to build:
ng build --prod --source-map=false && cordova build ios
Our config.xml file
<?xml version='1.0' encoding='utf-8'?>
<widget android-activityName="appname" android-versionCode="10002" id="appname" version="1.0.2" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>appname</name>
<description>
Description
</description>
<author email="Support#appname.com" href="http://appname.com">
appname
</author>
<content src="index.html" />
<allow-navigation href="*" />
<allow-intent href="*" />
<access origin="*" />
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
<application android:usesCleartextTraffic="true" />
</edit-config>
<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:*" />
<icon density="ldpi" src="res/icon/android/ldpi.png" />
<preference name="CustomURLSchemePluginClearsAndroidIntent" value="true" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<icon density="ldpi" src="res/icon/android/ldpi.png" />
</platform>
<hook src="hooks/appBeforeBuild.js" type="before_build" />
<hook src="hooks/appBeforeBuild.js" type="before_run" />
<engine name="browser" spec="^5.0.3" />
<plugin name="cordova-plugin-dbcopy" spec="^2.1.2" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
<plugin name="cordova-plugin-network-information" spec="^2.0.1" />
<plugin name="uk.co.workingedge.cordova.plugin.sqliteporter" spec="^1.1.0" />
<plugin name="cordova-plugin-device" spec="^2.0.2" />
<plugin name="cordova-plugin-printer" spec="^0.7.3" />
<plugin name="cordova-plugin-file-transfer" spec="^1.7.1" />
<plugin name="cordova-plugin-customurlscheme" spec="^4.4.0">
<variable name="URL_SCHEME" value="URL_SCHEME_NAME" />
<variable name="ANDROID_SCHEME" value=" " />
<variable name="ANDROID_HOST" value=" " />
<variable name="ANDROID_PATHPREFIX" value="/" />
</plugin>
<plugin name="cordova-plugin-dialogs" spec="^1.3.3" />
<plugin name="cordova-plugin-bluetoothle" spec="^4.5.10" />
<plugin name="cordova-plugin-bluetooth-peripheral-usage-description" spec="^1.0.1">
<variable name="TEXT" value="Some string" />
</plugin>
<plugin name="cordova-plugin-geolocation" spec="^4.0.2" />
<plugin name="cordova-plugin-android-permissions" spec="^1.0.2" />
<plugin name="cordova-plugin-ble-central" spec="^1.2.5" />
<plugin name="cordova-plugin-inappbrowser" spec="^3.2.0" />
<plugin name="cordova-plugin-permission" spec="^0.1.0" />
<plugin name="cordova-plugin-vibration" spec="^3.1.1" />
</widget>
Unfortunately, white screen errors are pretty generic, as the error condition isn't listed in the console (see Cordova - white screen after splash, no exceptions in console).
You can, however, launch the app in the iOS simulator and hook it up to Safari's dev tools, and then hit refresh. It should kick out the exception that iOS is running into.

phonegap app no network connection on Android 9 Pie

I have a phonegap app that is working on every Android Version except 9 Pie.
Navigating to a website works. That means my allow-navigation tags must be correct.
But sending a XMLHttpRequest I get no data.
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function(){
if(xmlhttp.readyState==4){
if(xmlhttp.status==200){
var info = xmlhttp.responseXML;
if(info!=null){
//doLog(xmlhttp.responseText);
...
}
} else {
doLog("Server answer: " + xmlhttp.status + " " + xmlhttp.statusText);
}
}
}
xmlhttp.open("GET", serverURL + url, true);
xmlhttp.send();
I read you need minSdkVersion of 17 for apps to work with android 9. Mine has 19 already. TargetSdkVersion is 28.
Of course I use whitelist plugin.
<preference name="phonegap-version" value="cli-8.2.2" />
<preference name="keepRunning" value="true" />
<preference name="android-minSdkVersion" value="19" />
<preference name="android-targetSdkVersion" value="28" />
<preference name="android-build-tool" value="gradle" />
<access launch-external="yes" origin="geo:*" />
<access launch-external="yes" origin="mailto:*" />
<access launch-external="yes" origin="http://*" />
<access launch-external="yes" origin="https://*" />
<access origin="*" />
<allow-navigation href="http://*/*" />
<allow-navigation href="https://*/*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
Anyone an idea?
Problem vanished.
What I changed before this release build:
Added
<preference name="phonegap-version" value="cli-8.2.2" />
Reinstalled whitelist plugin.

Cordova ionic can't connect to to any internet services

I've been building an app with cordova and ionic using angular js. When I complile the project to android everything works fine, but with iOS I can't connect to anything.
I'm trying to log in to firebase database, as well as exchange some HTTP requests. again, all works fine on android.
Here's my config.xml:
<?xml version='1.0' encoding='utf-8'?>
<widget id="private.private.private" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Puurs 725</name>
<description>An awesome Ionic/Cordova app.</description>
<author email="hi#ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
<content src="index.html" />
<access origin="*" />
<allow-navigation href="http://ionic.local/*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<allow-navigation href="*://*youtube.com" />
<allow-navigation href="*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="16" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar" />
</feature>
<plugin name="ionic-plugin-keyboard" spec="~2.2.1" />
<plugin name="cordova-plugin-whitelist" spec="1.3.1" />
<plugin name="cordova-plugin-console" spec="1.0.5" />
<plugin name="cordova-plugin-statusbar" spec="2.2.1" />
<plugin name="cordova-plugin-device" spec="1.1.4" />
<plugin name="cordova-plugin-splashscreen" spec="~4.0.1" />
<plugin name="NetworkStatus" value="CDVConnection" />
<plugin name="cordova-plugin-googleplus" spec="~5.1.1">
<variable name="REVERSED_CLIENT_ID" value="com.googleusercontent.apps.lotsofprivatenumbers" />
</plugin>
</widget>
Fun thing is that this was supposed to be working. But I accidently overwrote my index.html file. In there meta data for my index I have:
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
Rings a bell to anyone?
Well, I learned how to hook up my ipad running the app to my mac, debugged the safari console (this feature is awesome) and found out a javascript error was blocking further executions.
More specific, Object.values is not supported on safari.

.IPA installation stuck on IPhone 5s( ios 10.0.2)

I am trying to install .IPA File But it always got stuck. I had
confirmed UDID's of Device .I also had made a experiment in which i
created a blank application for ios But it also got stuck at
installing.I had tested same application on multiple device its working perfect on other IOS Devices e.g iphone4s ,ipad pro.
Here is my Config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.unitedway" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
<name>VMS</name>
<description>Volunteer Management System, Phone Application</description>
<author email="support#phonegap.com" href="http://phonegap.com">PhoneGap Team</author>
<content src="index.html" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="14" />
<preference name="fullscreen" value="false" />
<icon src="icon.png" />
<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:*" />
</platform>
<plugin name="cordova-plugin-file" spec="~4.3.0" />
<plugin name="cordova-plugin-whitelist" spec="~1.3.0" />
<plugin name="cordova-plugin-network-information" spec="~1.3.0" />
</widget>
its not a Ad-hoc Provisioning Profile
That's the problem. The only apps that you can install onto your phone in this way are:
An app you downloaded from the iTunes app store
An app with an ad hoc provisioning profile that lists this device in its profile (this is a Deployment provisioning profile, and you have to have a developer membership in order to create one)

Resources