-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
invoke server method,how get return value,eg string #11
Comments
Hi, I'll need some more information to help. Can you post some of your client code? In general, you should have something like this: SwiftR.connect("http://yourserver.com") { connection in
self?.complexHub = connection.createHubProxy("complexHub")
self?.complexHub.on("notifyComplex") { args in
let m: AnyObject = args!["0"] as AnyObject!
print(m)
}
} |
I need some method like SignalR-objc method,like below code |
OK, I see. I haven't added support for |
Commit fb4fdce adds this support. The invoke signature is now: public func invoke(method: String, arguments: [AnyObject]?, callback: ((AnyObject?, String?) -> ())? = nil) Here's an example usage: simpleHub.invoke("sendSimple", arguments: ["Simple Test", "This is a simple message"]) { (result, error) in
if let e = error {
print("Error message: \(e)")
} else {
print("Success!")
if let r = result {
print("Result: \(r)")
}
}
} |
Thank you! |
Change is included in v0.8.1. |
invoke server method,how get return value,eg string,thank you
public string SendComplex(ComplexMessage message) {
}
The text was updated successfully, but these errors were encountered: