0

I am working on an Ionic project. For this, I need to control the data connection (4G & wifi).

For this, I saw that an Ionic plugin exists: WifiWizard2. In the documentation, it is written:

WifiWizard2.enableWifi()

and

WifiWizard2.disableWifi()

It will turn on / off the wifi, but how can I turn off the 4G / 3G / etc. ? It is also writted :

WifiWizard2.listNetworks();

With this, I can get a list of networks and SSID. But I assume that it will only get wifi's SSID. How can I get 4G? And also, will the smartphone can connect to it?

Maybe the plugin can't do that, if not, what is the solution? Is it allowed on Android? (to control data connection).

If someone knows how to help me, I would be really grateful!

André Sousa
  • 1,692
  • 1
  • 12
  • 23

1 Answers1

1

You can't, for security reasons this is disabled.

How to enable mobile data on/off programmatically [duplicate]

Other way to do it, turn mobile in airplane mode, that is not possible:

how-to-programmatically-enable-and-disable-flight-mode-on-android-4-2

Guillem Perez
  • 266
  • 2
  • 9