Every Wi-Fi network check, except for the cordova wifi password

I developed a wifi application using wifiwizard and cordova for Android devices and it works great. I can choose a network, and I can put a password, and I can verify it and connect to it. But the problem is that my company received some additional checks, such as identification number, type of employee and some other details. So, as I suppose, to do these things or how to add them to certain networks. I downloaded all my wifi application, which works exactly as I expected. Please take a look and help me make it even better.

index.html

<!DOCTYPE html> <head> <meta name="format-detection" content="telephone=no"> <meta name="msapplication-tap-highlight" content="no"> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width"> <link rel="stylesheet" type="text/css" href="css/style.css"> <title>Wifi Wizard</title> </head> <body> <div class = "content"> <table id = "displayNetworks" class = "table-responsive"> </table> </div> <script type="text/javascript" src="js/jquery-1.12.4.js"></script> <script type="text/javascript" src="cordova.js"></script> <script type="text/javascript" src="js/app.js"></script> </body> </html> 

app.js

 var unique_array = []; $(document).ready(function(){ if(navigator.userAgent.match(/(iPhone|iPad|iPod|Android|BlackBerry)/)){ document.addEventListener("deviceready", onDeviceReady, false); }else{ onDeviceReady(); } }); function onDeviceReady(){ alert("I'm into the browser for debug"); window.setTimeout(function(){ WifiWizard.setWifiEnabled(true, win_enable, fail_enable); }, 200); } function win_enable(){ alert("Wifi Enabled successfully"); } function fail_enable(e){ alert(e.message); } window.setTimeout(function(){ alert("I'm in here"); WifiWizard.startScan(success_scan, fail_scan); }, 1000); function success_scan(){ alert("Trying to connect scan function"); window.setTimeout(function(){ getScanResult(); }, 2000); } function fail_scan(e){ alert(e.message); } function getScanResult(){alert("Im here too getting the scan result"); WifiWizard.getScanResults(listHandler, fail_network); } function listHandler(a){ alert(JSON.stringify(a)); var network_array = []; for(var i = 0; i < a.length; i++){ network_array.push(a[i].SSID); } unique_array = network_array.filter(function(elem, pos){ return network_array.indexOf(elem) == pos; }); alert(network_array); var content = "<table>" for(var j = 0; j < network_array.length; j++){ content += '<tr class="dynamicTable"><td><a href="javascript:void(0);" onclick="clickWifi(\'' + network_array[j] + '\');">' + network_array[j] + '</a></td></tr>'; } content += "</table>" document.getElementById('displayNetworks').innerHTML = content; } function fail_network(e){ alert(e.message); } function clickWifi(netssid){ alert("Hello Im inside click function"); var id = netssid; alert(id); var promptWindow = prompt("Please enter the password for the network: " + id); alert(promptWindow); var connectWifi = WifiWizard.formatWPAConfig(id, promptWindow); WifiWizard.addNetwork(connectWifi, function(){ WifiWizard.connectNetwork(id, connectSuccess, connectFailed); }); } function connectSuccess(e){ alert("Connected Successfully"); window.open("http://www.google.com", "_self"); } function connectFailed(e){ alert(e.message); } 

And also I have a problem with window.open in the connectSuccess function, window.open does not work inside my application, and if I exit my application, I can contact Google.

config.xml

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <widget id="com.ionicframework.wifiexpandables353717" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>WifiExpandables</name> <description> An Ionic Framework and Cordova project. </description> <author email=" you@example.com " href="http://example.com.com/"> Your Name Here </author> <content src="index.html"/> <access origin="*"/> <preference name="webviewbounce" value="false"/> <preference name="UIWebViewBounce" value="false"/> <preference name="DisallowOverscroll" value="true"/> <preference name="SplashScreenDelay" value="2000"/> <preference name="FadeSplashScreenDuration" value="2000"/> <preference name="android-minSdkVersion" value="16"/> <preference name="BackupWebStorage" value="none"/> <preference name="SplashScreen" value="screen"/> <feature name="StatusBar"> <param name="ios-package" value="CDVStatusBar" onload="true"/> </feature> <platform name="android"> <icon src="resources/android/icon/drawable-ldpi-icon.png" density="ldpi"/> <icon src="resources/android/icon/drawable-mdpi-icon.png" density="mdpi"/> <icon src="resources/android/icon/drawable-hdpi-icon.png" density="hdpi"/> <icon src="resources/android/icon/drawable-xhdpi-icon.png" density="xhdpi"/> <icon src="resources/android/icon/drawable-xxhdpi-icon.png" density="xxhdpi"/> <icon src="resources/android/icon/drawable-xxxhdpi-icon.png" density="xxxhdpi"/> <splash src="resources/android/splash/drawable-land-ldpi-screen.png" density="land-ldpi"/> <splash src="resources/android/splash/drawable-land-mdpi-screen.png" density="land-mdpi"/> <splash src="resources/android/splash/drawable-land-hdpi-screen.png" density="land-hdpi"/> <splash src="resources/android/splash/drawable-land-xhdpi-screen.png" density="land-xhdpi"/> <splash src="resources/android/splash/drawable-land-xxhdpi-screen.png" density="land-xxhdpi"/> <splash src="resources/android/splash/drawable-land-xxxhdpi-screen.png" density="land-xxxhdpi"/> <splash src="resources/android/splash/drawable-port-ldpi-screen.png" density="port-ldpi"/> <splash src="resources/android/splash/drawable-port-mdpi-screen.png" density="port-mdpi"/> <splash src="resources/android/splash/drawable-port-hdpi-screen.png" density="port-hdpi"/> <splash src="resources/android/splash/drawable-port-xhdpi-screen.png" density="port-xhdpi"/> <splash src="resources/android/splash/drawable-port-xxhdpi-screen.png" density="port-xxhdpi"/> <splash src="resources/android/splash/drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi"/> </platform> </widget> 
+1
source share
1 answer

Add the following lines to config.xml. It should work fine.

 <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> 
+1
source

All Articles