I am trying to enable and disable the offline mode automatically in android using react-native code, I want to know whether is there any possibility like that in react-native, If possible can any one give me suggestions that how can i achieve it. Any help must be much appreciated.
Thank you.
Try this link https://www.npmjs.com/package/react-native-system-setting
import SystemSetting from 'react-native-system-setting'
SystemSetting.isAirplaneEnabled().then((enable)=>{
const state = enable ? 'On' : 'Off';
console.log('Current airplane is ' + state);
})
SystemSetting.switchAirplane(()=>{
console.log('switch airplane successfully');
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With