How to fix Meteor emulator cannot get results from method using callback

Meteor

 

If you’re reading this entry you’ve likely also read this Stackoverflow (https://stackoverflow.com/questions/25722933/meteor-how-do-i-make-this-reactive-using-deps) post that lists four methods to get data on the client side reactively from the server. One particular thing that was missed/unmentioned is that you need to ensure that you have the proper cordova rules for your app. These rules explicitly allow named hosts and implicitly deny all hosts the client may communicate with.

If you’re using a local emulation instance using VirtualBox or Genymotion you will want to include these directives in your mobile-config.js file in the root of your meteor project. This will save you a hours of frustrations, for sure.

// LOCAL ACCESS RULES
App.accessRule('https://localhost*');
App.accessRule('http://localhost*');

App.accessRule('https://192.168.*');
App.accessRule('http://192.168.*');

//GENYMOTION DEV, LOCAL EMULATOR DEV IPS
App.accessRule('http://10.*');
App.accessRule('https://10.*');