Skip to content
This repository has been archived by the owner on May 20, 2021. It is now read-only.

Call method on server and get result back #57

Closed
thetof91 opened this issue Aug 21, 2015 · 4 comments
Closed

Call method on server and get result back #57

thetof91 opened this issue Aug 21, 2015 · 4 comments

Comments

@thetof91
Copy link

Hello

I got a method on server, that gives a result back. And over in my swift project I want to call the method on the server and get the result back from the server, so I can use it in my swift project.

How do I best do this?

@pozylon
Copy link

pozylon commented Aug 21, 2015

extension Group {
func enterGroup(finished: (success: Bool)->()) {
let id : String = Meteor.documentKeyForObjectID(self.objectID).documentID as! String

    Meteor.callMethodWithName("enterGroup", parameters: [id]) { (obj, err) -> Void in
        if (err != nil) {
            finished(success: false)
        } else {
            //Kita.invalidateKidsList()
            finished(success: true)
        }
    }
}

@thetof91
Copy link
Author

Can you maybe explain it a bit?

I got the method "joinSession" written in meteor on the server, that method give a result back in JSON..

@pozylon
Copy link

pozylon commented Aug 24, 2015

@thetof91
Copy link
Author

I will look at it. Thanks for help so far :)

Parse to JSON is not the problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants