Check that WIFI is turned on is React Native iOS app
up vote
1
down vote
favorite
Do you know how it is possible to check that WIFI is turned on is React Native iOS app. Due to the aGPS on iOS devices, the WIFI must be turned on in order for our location sensitive app to be able to work effectively and we want to notify the user in cases it is turned off.
Any idea how to achieve this in a React Native app for iOS?
ios react-native wifi
add a comment |
up vote
1
down vote
favorite
Do you know how it is possible to check that WIFI is turned on is React Native iOS app. Due to the aGPS on iOS devices, the WIFI must be turned on in order for our location sensitive app to be able to work effectively and we want to notify the user in cases it is turned off.
Any idea how to achieve this in a React Native app for iOS?
ios react-native wifi
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Do you know how it is possible to check that WIFI is turned on is React Native iOS app. Due to the aGPS on iOS devices, the WIFI must be turned on in order for our location sensitive app to be able to work effectively and we want to notify the user in cases it is turned off.
Any idea how to achieve this in a React Native app for iOS?
ios react-native wifi
Do you know how it is possible to check that WIFI is turned on is React Native iOS app. Due to the aGPS on iOS devices, the WIFI must be turned on in order for our location sensitive app to be able to work effectively and we want to notify the user in cases it is turned off.
Any idea how to achieve this in a React Native app for iOS?
ios react-native wifi
ios react-native wifi
asked Nov 7 at 16:54
Va5ili5
8810
8810
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
Use NetInfo
to check if the device is connected to wifi/cellular in React Native.
NetInfo exposes info about online/offline status
NetInfo.getConnectionInfo().then((connectionInfo) => {
console.log('Initial, type: ' + connectionInfo.type + ', effectiveType: ' + connectionInfo.effectiveType);
});
function handleFirstConnectivityChange(connectionInfo) {
console.log('First change, type: ' + connectionInfo.type + ', effectiveType: ' + connectionInfo.effectiveType);
NetInfo.removeEventListener(
'connectionChange',
handleFirstConnectivityChange
);
}
NetInfo.addEventListener(
'connectionChange',
handleFirstConnectivityChange
);
ConnectionType
describes the type of connection the device is using to communicate with the network.
Cross platform values for ConnectionType
:
none - device is offline
wifi - device is online and connected via wifi, or is the iOS simulator
cellular - device is connected via Edge, 3G, WiMax, or LTE
unknown - error case and the network status is unknown
For more please visit https://facebook.github.io/react-native/docs/netinfo
1
I think what he means is if there is a way to check if wifi is open in order to have AGPS signal while the device is connected via cellular 3G/4G
– Giorgos Kartalis
Nov 8 at 12:40
Indeed most of the time users would be driving and would not be connected to a wifi router. Nonetheless, an iOS device's aGPS requires the wifi to be turned on (even though not connected but must not be disabled). What I need is to know if it is turned on or off not to know that I am connected through 4G.
– Va5ili5
Nov 8 at 16:57
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Use NetInfo
to check if the device is connected to wifi/cellular in React Native.
NetInfo exposes info about online/offline status
NetInfo.getConnectionInfo().then((connectionInfo) => {
console.log('Initial, type: ' + connectionInfo.type + ', effectiveType: ' + connectionInfo.effectiveType);
});
function handleFirstConnectivityChange(connectionInfo) {
console.log('First change, type: ' + connectionInfo.type + ', effectiveType: ' + connectionInfo.effectiveType);
NetInfo.removeEventListener(
'connectionChange',
handleFirstConnectivityChange
);
}
NetInfo.addEventListener(
'connectionChange',
handleFirstConnectivityChange
);
ConnectionType
describes the type of connection the device is using to communicate with the network.
Cross platform values for ConnectionType
:
none - device is offline
wifi - device is online and connected via wifi, or is the iOS simulator
cellular - device is connected via Edge, 3G, WiMax, or LTE
unknown - error case and the network status is unknown
For more please visit https://facebook.github.io/react-native/docs/netinfo
1
I think what he means is if there is a way to check if wifi is open in order to have AGPS signal while the device is connected via cellular 3G/4G
– Giorgos Kartalis
Nov 8 at 12:40
Indeed most of the time users would be driving and would not be connected to a wifi router. Nonetheless, an iOS device's aGPS requires the wifi to be turned on (even though not connected but must not be disabled). What I need is to know if it is turned on or off not to know that I am connected through 4G.
– Va5ili5
Nov 8 at 16:57
add a comment |
up vote
1
down vote
Use NetInfo
to check if the device is connected to wifi/cellular in React Native.
NetInfo exposes info about online/offline status
NetInfo.getConnectionInfo().then((connectionInfo) => {
console.log('Initial, type: ' + connectionInfo.type + ', effectiveType: ' + connectionInfo.effectiveType);
});
function handleFirstConnectivityChange(connectionInfo) {
console.log('First change, type: ' + connectionInfo.type + ', effectiveType: ' + connectionInfo.effectiveType);
NetInfo.removeEventListener(
'connectionChange',
handleFirstConnectivityChange
);
}
NetInfo.addEventListener(
'connectionChange',
handleFirstConnectivityChange
);
ConnectionType
describes the type of connection the device is using to communicate with the network.
Cross platform values for ConnectionType
:
none - device is offline
wifi - device is online and connected via wifi, or is the iOS simulator
cellular - device is connected via Edge, 3G, WiMax, or LTE
unknown - error case and the network status is unknown
For more please visit https://facebook.github.io/react-native/docs/netinfo
1
I think what he means is if there is a way to check if wifi is open in order to have AGPS signal while the device is connected via cellular 3G/4G
– Giorgos Kartalis
Nov 8 at 12:40
Indeed most of the time users would be driving and would not be connected to a wifi router. Nonetheless, an iOS device's aGPS requires the wifi to be turned on (even though not connected but must not be disabled). What I need is to know if it is turned on or off not to know that I am connected through 4G.
– Va5ili5
Nov 8 at 16:57
add a comment |
up vote
1
down vote
up vote
1
down vote
Use NetInfo
to check if the device is connected to wifi/cellular in React Native.
NetInfo exposes info about online/offline status
NetInfo.getConnectionInfo().then((connectionInfo) => {
console.log('Initial, type: ' + connectionInfo.type + ', effectiveType: ' + connectionInfo.effectiveType);
});
function handleFirstConnectivityChange(connectionInfo) {
console.log('First change, type: ' + connectionInfo.type + ', effectiveType: ' + connectionInfo.effectiveType);
NetInfo.removeEventListener(
'connectionChange',
handleFirstConnectivityChange
);
}
NetInfo.addEventListener(
'connectionChange',
handleFirstConnectivityChange
);
ConnectionType
describes the type of connection the device is using to communicate with the network.
Cross platform values for ConnectionType
:
none - device is offline
wifi - device is online and connected via wifi, or is the iOS simulator
cellular - device is connected via Edge, 3G, WiMax, or LTE
unknown - error case and the network status is unknown
For more please visit https://facebook.github.io/react-native/docs/netinfo
Use NetInfo
to check if the device is connected to wifi/cellular in React Native.
NetInfo exposes info about online/offline status
NetInfo.getConnectionInfo().then((connectionInfo) => {
console.log('Initial, type: ' + connectionInfo.type + ', effectiveType: ' + connectionInfo.effectiveType);
});
function handleFirstConnectivityChange(connectionInfo) {
console.log('First change, type: ' + connectionInfo.type + ', effectiveType: ' + connectionInfo.effectiveType);
NetInfo.removeEventListener(
'connectionChange',
handleFirstConnectivityChange
);
}
NetInfo.addEventListener(
'connectionChange',
handleFirstConnectivityChange
);
ConnectionType
describes the type of connection the device is using to communicate with the network.
Cross platform values for ConnectionType
:
none - device is offline
wifi - device is online and connected via wifi, or is the iOS simulator
cellular - device is connected via Edge, 3G, WiMax, or LTE
unknown - error case and the network status is unknown
For more please visit https://facebook.github.io/react-native/docs/netinfo
answered Nov 7 at 16:58
Sateesh
1,300615
1,300615
1
I think what he means is if there is a way to check if wifi is open in order to have AGPS signal while the device is connected via cellular 3G/4G
– Giorgos Kartalis
Nov 8 at 12:40
Indeed most of the time users would be driving and would not be connected to a wifi router. Nonetheless, an iOS device's aGPS requires the wifi to be turned on (even though not connected but must not be disabled). What I need is to know if it is turned on or off not to know that I am connected through 4G.
– Va5ili5
Nov 8 at 16:57
add a comment |
1
I think what he means is if there is a way to check if wifi is open in order to have AGPS signal while the device is connected via cellular 3G/4G
– Giorgos Kartalis
Nov 8 at 12:40
Indeed most of the time users would be driving and would not be connected to a wifi router. Nonetheless, an iOS device's aGPS requires the wifi to be turned on (even though not connected but must not be disabled). What I need is to know if it is turned on or off not to know that I am connected through 4G.
– Va5ili5
Nov 8 at 16:57
1
1
I think what he means is if there is a way to check if wifi is open in order to have AGPS signal while the device is connected via cellular 3G/4G
– Giorgos Kartalis
Nov 8 at 12:40
I think what he means is if there is a way to check if wifi is open in order to have AGPS signal while the device is connected via cellular 3G/4G
– Giorgos Kartalis
Nov 8 at 12:40
Indeed most of the time users would be driving and would not be connected to a wifi router. Nonetheless, an iOS device's aGPS requires the wifi to be turned on (even though not connected but must not be disabled). What I need is to know if it is turned on or off not to know that I am connected through 4G.
– Va5ili5
Nov 8 at 16:57
Indeed most of the time users would be driving and would not be connected to a wifi router. Nonetheless, an iOS device's aGPS requires the wifi to be turned on (even though not connected but must not be disabled). What I need is to know if it is turned on or off not to know that I am connected through 4G.
– Va5ili5
Nov 8 at 16:57
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53194187%2fcheck-that-wifi-is-turned-on-is-react-native-ios-app%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown