Meteor.call doesn't work on android App


#1

Did somebody try creating an app for android/ios with Meteor 1.3? I created a simple app wich has only one method. It works like that: When a button is clicked, the method is invoked - it calculates a specific value and returns the result.

The app works perfectly on the localhost server, but when I launch it on my device with “meteor run android-device”, it cannot access the method (simply opens the app, but nothing happens when I press a button.

Do you know how I could resolve this?

import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';
import { ReactiveDict } from 'meteor/reactive-dict';

import './main.html';

Template.check.onCreated(function checkOnCreated() {
   this.state = new ReactiveDict();
});

Template.check.events({
 'click .checkit'(event, instance) {

    Meteor.call('code.check', function(error, result){
      if(error){
        console.log('Error from the client side!');
      } else {
        instance.state.set('fett', result.titles[0]);
      }
    });
   },

});

  Template.check.helpers({

    fett() {
      const instance = Template.instance();
      if (instance.state.get('fett')) {
         return instance.state.get('fett');
      } else {
         return 'Value still not known...'
      }
    },
  });

#3

I fixed that part in the code, but unfortunately, it didn’t resolve the problem. I think the problem is that Mateor.call is never executed because no error message is displayed! The value of the reactive variable just never changes.


#5

I’m opening the program on my android with “meteor run android-device”. It automatically creates an app on my phone which then I can launch. Both are connected to the same WiFi…


#6

It could be the “click” event!

Is at least one of mobile-experience or fastclick packages installed?

Because on mobile, a click is not triggered within the first 300ms therefore your event handler might actually not be firing due to that!