Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import ScreenTracker from './src/ScreenTracker';
import Authentication from './src/Authentication';
const androidEmulatorServerUrl = 'http://169.254.80.80:5000';
const liveServerUrl = 'http://dotnetify.net';
const serverUrl = Platform.OS === 'android' ? androidEmulatorServerUrl : liveServerUrl;
dotnetify.debug = true;
// Live server is still running an older signalR version, which requires a different SignalR client library.
if (serverUrl == liveServerUrl) {
dotnetify.hubLib = signalRnetfx;
dotnetify.hubServerUrl = serverUrl + '/signalr';
dotnetify.hubOptions.pingInterval = 60000;
}
else dotnetify.hubServerUrl = serverUrl;
Authentication.url = serverUrl + '/token';
export default class App extends React.Component {
state = { appLoaded: false, connectionStatus: null };
constructor(props) {
super(props);
dotnetify.connectionStateHandler = (state, ex) => {
this.setState({ connectionStatus: state == 'connected' ? null : state });
if (state == 'error') Alert.alert('Connection Error', ex.message, [ { text: 'OK' } ], { cancelable: false });
};
}
componentWillMount() {