You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
If the user is offline when the app starts and then later comes online, am I correct that this will not check the app version once the user goes online?
The text was updated successfully, but these errors were encountered:
2. Handle the network connection on your app side:
importReact,{useState,useEffect}from'react';import{View,Text,Platform}from'react-native';importNetInfofrom'@react-native-community/netinfo';importDeviceInfofrom'react-native-device-info';import{ForceUpdate}from'reactnative-forceupdate';constApp=()=>{const[isConnected,setIsConnected]=useState<boolean|null>(null);useEffect(()=>{constunsubscribe=NetInfo.addEventListener((state)=>{setIsConnected(state.isConnected);});return()=>unsubscribe();},[]);constversion=DeviceInfo.getVersion();constlanguage='en';constplatform=Platform.OS==='ios' ? 'IOS' : 'ANDROID';constapiKey='YOUR_API_KEY_HERE';if(isConnected===false){return(<View><Text> Your app flow will go here </Text></View>);}return(<ForceUpdateapi_key={apiKey}language={language}platform={platform}version={version}><View><Text> Your app flow will go here </Text></View></ForceUpdate>);};exportdefaultApp;
I could easily add the handle above on the code, but the component has a premise to be zero dependencies. I'll think a way to implement that behavior on the main package.
Hi,
If the user is offline when the app starts and then later comes online, am I correct that this will not check the app version once the user goes online?
The text was updated successfully, but these errors were encountered: