Here the user has the facility to check the Internet facility by using method.
Smart Code
Syntax
CheckInternet(Variable)
Parameter
Variable – Name of the variable to save the return status
Direct Code
Syntax
this.setState({ spinner: true })
try {
var <<Variable_Name>> =await Orefuncs.isNetworkAvailable();
if(<<Variable_Name>> == undefined || Check == false){
this.setState({ spinner: false });
OreAlert.alert(“Network Error”, “Please check the network connection and try again.”, “Try Again”, this.callback, false);
return;
}
}
catch(ex) {
OreAlert.alert(ex.message);
}
this.setState({ spinner: false });
}