Has anyone any experience debugging server connectivity between Android apps and modulus?


#1

I’m deploying to modulus.io using modulus deploy.

The web app works as expected.

However, the android application fails to connect to the server and I get a bunch of cors errors. These may or may not be important as it seems the ROOT_URL env var isn’t being picked up/set correctly so that the apps requests appear to be coming from localhost:3000

ROOT_URL is specified in the modulus server administration.

Sample CORS error… retrieved from inspecting a Genymotion virtual device pointing at the live server with --mobile-server. Using Meteor 1.3

"XMLHttpRequest cannot load my.server.address/sockjs/info?cb=89f86firjs. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:12664’ is therefore not allowed access. "


#2

In one of my apps I solved the ROOT_URL thing by also passing
DDP_DEFAULT_CONNECTION_URL=https://www.mystuff.com:443 to the build

Seems a lot like duplication, but I read this somewhere and it worked for that app.

The CORS thing has often caused me headaches, but in the end all you should need is a mobile-config.js with the line:
App.accessRule('*');

If that works, you can later get more restrictive with your App.accessRule


#3

Awesome thanks. I’ll try that!

edit: Yes… The accessRule seemed to sort out my cors errors alright