How to use the react-native-config.SERVER_URL function in react-native-config

To help you get started, we’ve selected a few react-native-config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alex-friedl / crossplatform-push-notifications-example / app / js / index.js View on Github external
const sendTokenToServer = (token) => {
  console.log(`Sending token ${token} to server`);
  fetch(`${Config.SERVER_URL}/token/`, {
    method: 'POST',
    headers: {
      'Content-Type': 'text/plain',
    },
    body: token,
  })
    .then(() => { console.log('Successfully sent token'); })
    .catch((err) => { console.error('Failed to send token', err); });
};
github blindsidenetworks / bigbluetutor-client / client / React-Native / app / components / signin.js View on Github external
signIn() {
    this.state.ds = createDeepstream(Config.SERVER_URL);
    this.state.ds.on('error', (error, event, topic ) => {
      console.log(error, event, topic);
      Actions.reset('signin', {ds: this.state.ds, configurePush: this.props.configurePush})
    })
    GoogleSignin.configure({
      iosClientId: Config.IOS_CLIENT_ID,
      webClientId: Config.WEB_CLIENT_ID
    })
    GoogleSignin.signIn()
    .then((user) => {
      this.state.ds.login({idToken: user.idToken, platform: Platform.OS}, (success, data) => {
        if(success) {
          this.state.username = data.username;
          this.state.profileRecord = this.props.ds.record.getRecord('profile/'+ this.state.username);
          this.state.dataRecord = this.props.ds.record.getRecord('data');
          this.state.profileRecord.whenReady(() => {
github blindsidenetworks / bigbluetutor-client / React-Native / BigBlueTutor.js View on Github external
componentWillMount() {
    this.state.ds = createDeepstream(Config.SERVER_URL);
  }
github blindsidenetworks / bigbluetutor-client / client / React-Native / app / BigBlueTutor.js View on Github external
componentWillMount() {
    this.state.ds = createDeepstream(Config.SERVER_URL);
  }