Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how do you connect to Meteor server? #26

Open
kokokenada opened this issue May 6, 2017 · 3 comments
Open

how do you connect to Meteor server? #26

kokokenada opened this issue May 6, 2017 · 3 comments

Comments

@kokokenada
Copy link

kokokenada commented May 6, 2017

I am unable to get a connection to Meteor. I've configured DDP_DEFAULT_CONNECTION_URL to be the IP of my machine. The code below is called every 5 seconds, and it just won't connect. Using fetch, I'm able to hit the server with no problem.

    Meteor.connect(server.result);
    Meteor.reconnect();
    fetch(server.result)
      .then( (response) => {
        console.log('Fetch returned data:'); // This works
        console.log(response);
      }, (error) => {
        console.log('Fetch returned error:');
        console.log(error);
      })

(I've tried with and without the reconnect)

Full repo is here: https://github.com/kokokenada/for-real-cards-rn . Tried with a device and with emulator.

@DAB0mB
Copy link
Collaborator

DAB0mB commented May 7, 2017

It should get connected by its own. Why do you need to register the connection manually?

@kokokenada
Copy link
Author

The code only gets called when there is no connection. And, yes, when using the web version, things would usually just connect on their own.

Also, I looked at the boilerplate code (https://github.com/DAB0mB/ReactNativeMeteorBoilerplate ) and it looks like it's supposed to display foo, bar, baz. This doesn't happen when I download and run the repo. (I just see a white screen)

@DAB0mB
Copy link
Collaborator

DAB0mB commented May 8, 2017

@kokokenada I will check the re-connection thing, and regards the boilerplate, I'ts probably caused due to the separation between the device and the server on the local machine. If configured correctly, it should work. I will try to run it on a MacOS to see if it works there or not, and I will give you a status once I have results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants