inProgress-team / inProgress-team/react-native-meteor

[Question] trouble with connecting android to local meteor app in a same WIFI network

Open
#175 17 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
688
Forks
200
PR merge metrics
No merged PRs in 30d

Description

Hi guys,
I can connect successfully to a deployed Meteor app (on a VPS) and ddp but when I try to connect to a **localhost** with this url `const url = 'ws://localhost:3000/websocket';` or `const url = 'ws://127.0.0.1:3000/websocket';` it's not connect and app in waiting in spinner (see below code) I also try my `ifconfig` output IP address like `const url = 'ws://192.168.1.102:3000/websocket';` but it's still not working.
Can you guide me about this?

This is my landing page code that app waiting there.
`LoginContainer` for reactive parts:

```
import React, { Component } from 'react';
import Meteor, { createContainer } from 'react-native-meteor';
import LoginComponent from '../routes/login';

export default LoginContainer = createContainer(() => {
return {
status: Meteor.status(),
loggingIn: Meteor.loggingIn(),
user: Meteor.user(),
userId: Meteor.userId()
}
}, LoginComponent);
```
And this is my `LoginComponent` for login form:

```
import React, { Component, PropTypes } from 'react';
import { Container, Content, Button, Text, List, Icon,
ListItem, InputGroup, Input, Item, Spinner } from 'native-base';
import Meteor from 'react-native-meteor';
import { Actions } from 'react-native-router-flux';

export default class LoginComponent extends Component {

constructor(props) {
super(props);
this.state = {
username: '',
password: '',
loginError: ''
};

this.handleClick = this.handleClick.bind(this);
this.handleUsernameChange = this.handleUsernameChange.bind(this);
this.handlePasswordChange = this.handlePasswordChange.bind(this);
}

handleClick() {
// handle login here
};

handleUsernameChange(text) {
this.setState({username: text});
};

handlePasswordChange(text) {
this.setState({password: text});
};

render() {
if (!this.props.status.connected) {
return (





);
}
return (


// my login form here


);

}
}

LoginComponent.propTypes = {
status: PropTypes.object,
loggingIn: PropTypes.bool.isRequired,
user: PropTypes.object,
userId: PropTypes.string
};
```

**/CC:** @noris666

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.