Comments (6)
Right now this is what I have to do to get this to work correctly, which seems kinda overkill:
let ssid = "some-ssid";
cordovaNetworkManager.getCurrentSSID( function( currentSSID ){
console.log( 'GET CURRENT SSID', currentSSID );
cordovaNetworkManager.androidConnectNetwork(ssid, currentSSID, function(s){
console.log('Connected to device WiFi...', s );
}, function(f){
console.log( 'Failed to connect to ', ssid );
});
}, function( f ){
console.log( 'FAILURE GET CURRENT SSID', f );
});
But that only works when connected to existing network, if not connected to existing network, it's not even possible to connect ....
from cordova-network-manager.
Here's something i found on parent repo regarding wifi enabled:
hoerresb/WifiWizard#6
from cordova-network-manager.
Like I've said before, I made this particular part for my personal application/use. It probably wasn't the best for a global solution and therefore was an oversight on my behalf. I need to parse in a very specific network to disable/enable and it isn't always the current network that's connected.
That being said, for a global solution, it would be best to do what you have described above. I am going away next week for 3 weeks however I will look to implement these changes before I go.
from cordova-network-manager.
Yeah completely understandable, I think I may actually just fork the main WiFiManager plugin and update that one, unless you want me to just submit a PR to you?
from cordova-network-manager.
I do not mind you submitting a PR. Simply follow the PR template and I'll review it all accordingly. :D
If you want to become a contributor to this plugin, let me know. I will be rewriting the Android platform since the OG WifiWizard is a bit trash and therefore the code in this is trash as well.
Contact me on Discord and we can talk about it more: Nomm#0176
Also see the open issue: #8
from cordova-network-manager.
Fixed as of release v2.2.0.
You can now just give it an empty string or a null object and it will still work.
If you notice the issue again, just create a new issue referencing this.
from cordova-network-manager.
Related Issues (18)
- connectNetwork function success callback should only fire when specified network connects
- How do I use getConnectedSSID HOT 3
- Is it possible to list available networks on iOS HOT 5
- Missing ACCESS_COARSE_LOCATION permission HOT 5
- Ios buidl faild in ionic3 when run "ionic cordova build ios". HOT 5
- xCode simulator fail HOT 2
- App crashes on iPhone 5 when 'getCurrentSSID' is called HOT 5
- IOS app breaks when WIFI password is shorter than 8 characters HOT 6
- addNetwork API fails HOT 2
- Error: The WIFI_SERVICE must be looked up on the Application context or memory will leak on devices < Android N HOT 1
- Error compile in IOS HOT 3
- ssidToNetworkId - check test.SSID before test.SSID.equals HOT 7
- Enable WiFi when calling funcs that require WiFi enabled HOT 5
- Improve documentation HOT 1
- getCurrentSSID() returns SSID even when not connected (getCurrentBSSID does not exist) HOT 4
- Rewrite Android Platform
- It does not work in IOS HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-network-manager.