Testing app on physical device = data appears just for 1 sec


#1

I made a very simple app, built it for Android and then installed on my phone.
After launching the server with “meteor run”, I run the app and I see the data
just for one second and then it just disappears. Like the collection was dropped.

If I test it on the browser or on the Android emulator, the data is right there. The collection is fine.

The code is something like that:

<template name="news">
{{ #each items }}
  <hr/>
  {{ title }}
{{ /each }}
</template>

.js

Headlines = new Meteor.Collection('headlines');
if (Meteor.isClient) {
  Meteor.subscribe('headlines');
  Template.news.helpers({
    items: function() {
      return Headlines.find();
    }
  });
}

if (Meteor.isServer) {
  Meteor.publish('headlines', function() {
    r = Headlines.find();
    return r;
  });
}

#2

I really don’t know what happened but when I deployed elsewhere (modulus, meteor.com) the app worked. Might have something to do with my local network. It is just weird that only happens on the physical device. :fish: