If you’ve used this plugin: https://ionicframework.com/docs/native/hotspot/
Then you can connect to wifi with following code:
this.hotspot.connectToWifi(ssid, password).then( () => {
//connection to the WiFi network was successfull
}).catch( () => {
//connection to the WiFi network failed
});
where ssid is name of any one wifi network from the list which you’ve already got.
If you’ve any doubts, feel free to ask.