Skip to content
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 method doesn't work with single quote & line translation #33

Closed
maksimkuznetsov opened this issue Apr 5, 2016 · 3 comments
Closed

Comments

@maksimkuznetsov
Copy link

When I send a string with single quote (') or line translation (\n) as an argument into invoke method, it doesn't return anything

let message = "FirsLine\n SecondLine\n SingleQuote' "
hub!.invoke("sendMessage", arguments: [message]){ (result, error) in
      print("SendMessage result: \(result)  error: \(error)")
}

I guess that in that case we'll get syntax error in JavaScript
Because I'm debugging invoke method in SwiftR.swift & variable «js» has this value

SwiftR.swift:476 connection.runJavaScript(js)
js  String  "ensureHub('chathub').invoke('sendMessage', 'FirsLine\n SecondLine\n SingleQuote' ').done(function() { postMessage({ message: 'invokeHandler', hub: 'chathub', id: '7DBE8B14-D170-4CB9-8332-3A29E96E0374', result: arguments[0] }); }).fail(function() { postMessage({ message: 'invokeHandler', hub: 'chathub', id: '7DBE8B14-D170-4CB9-8332-3A29E96E0374', error: processError(arguments[0]) }); })"  

Any ideas on how to resolve the issue?
Thanks

@adamhartford
Copy link
Owner

Thanks for the report. Yeah, I think I can fix that. I'll keep you posted.

@adamhartford
Copy link
Owner

Should be all set now. I'll do some more testing myself before publishing to Cocoapods, but let me know if you run into any issues.

@adamhartford
Copy link
Owner

Fixed in v0.10.1

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

No branches or pull requests

2 participants