0
votes

as the title says, is there a way (with Nativescript) to force the app to use the wifi connection for an http request? i am connected need wifi to a raspberry configured as hotspot without internet connection....my problem is when the smartphone is connected to the mobile data, it try to communicate with the datas due the fact that on wifi there isn't connection i suppose. if i disable mobile data it works because the unique connection is wifi. so is there a way to force the http request on wifi connection? sorry for my english, thank you

1

1 Answers

0
votes
var connectivity = require("connectivity");
switch (connectivity.getConnectionType()) {
case connectivity.connectionType.wifi:
    //http request or what do you want... 
    break;
default:
    break;
}

more info about connectivity , check this