delight-im / Android-DDP

[UNMAINTAINED] Meteor's Distributed Data Protocol (DDP) for clients on Android
Apache License 2.0
274 stars 54 forks source link

Methods from Accounts Package. #37

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hi,

I'm trying to call Accounts.callLoginMethod method from my Android device. But, I get an error: 404, Method not found.

Is there a possible way to call a method from a different package or is it a feature yet to be implemented?

Thanks, in advance.

ocram commented 8 years ago

Thanks for your question!

Not sure if you should really need to call this method. But anyway, this is not built into this library directly.

Nevertheless, you can easily make this work. You can call any method that your Meteor server exposes via the following command:

mMeteor.call("myMethod");

All the internal methods are implemented like this as well. If you want to see how it's done, here's an example.

Now you only have to find out the method names that you can call. You can get a list of all available method names by putting the following piece of code into your server files and watching the console:

Meteor.startup(function () {
    console.log(Object.keys(Meteor.server.method_handlers).sort());
});

Does this help?