作者:mobiledu2502908023 | 来源:互联网 | 2023-05-18 21:33
IammakingaPhonegapapp.Myrequirementistoshowdifferentviewstousersdependingonwhether
I am making a Phonegap app. My requirement is to show different views to users depending on whether they are using a home network or a public network. Is there any plugin or any other way that can help to get the connected network information. (Network SSID).
我正在制作一个Phonegap应用程序。我的要求是根据用户是使用家庭网络还是公共网络向用户显示不同的视图。是否有任何插件或任何其他方式可以帮助获取连接的网络信息。 (网络SSID)。
Thanks.
谢谢。
2 个解决方案
3
While WifiWizard is great, it seems that it's no longer being maintained on GitHub.
虽然WifiWizard很棒,但它似乎不再在GitHub上维护了。
As a replacement, you can use WifiWizard2 (link) which is under active development, as supports the same methods:
作为替代,您可以使用正在积极开发的WifiWizard2(链接),因为支持相同的方法:
cordova plugin install https://github.com/tripflex/WifiWizard2.git
cordova插件安装https://github.com/tripflex/WifiWizard2.git
WifiWizard2.getConnectedSSID(success, fail)
WifiWizard2.getConnectedBSSID(success, fail)
WifiWizard2.scan([options], success, fail)
WifiWizard2 also supports both Android and iOS.
WifiWizard2还支持Android和iOS。
However, if like me you also need to use the device's Hotspot or Wifi Tetheting on cordova, I recommend the cordova-hotspot-plugin instead.
但是,如果像我这样你还需要在cordova上使用设备的热点或Wifi Tetheting,我推荐使用cordova-hotspot-plugin。
The project is unfortunately discontinued, but for older Android API levels, still seems to work.
不幸的是,该项目已停止使用,但对于较旧的Android API级别,似乎仍然有效。
This plugin supports a myriad of methods, full list available here.
这个插件支持无数的方法,这里有完整列表。