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

Callback with data #25

Open
rscott78 opened this issue Aug 11, 2014 · 1 comment
Open

Callback with data #25

rscott78 opened this issue Aug 11, 2014 · 1 comment

Comments

@rscott78
Copy link

Hello -

I noticed when I send a message using the Jockey send method, there's no way to receive data back in the callback.

Is there a reason that this wasn't included? I.e., would it be possible to get the following with the callback function receiving a payload from the app?

Jockey.send("event-name", {
  key: "value"
}, function() {
  alert("iOS has finished processing!");
});
@tcoulter
Copy link
Owner

Hmm. It was never meant for two way communication within the same event, but I don't see why it wouldn't be possible. At worst (for now), you could just fire a new event from the iOS side in response with the data you're looking to send back.

If you'd like to fix that up and issue a PR, I wouldn't be against it. You'd need to be able to handle the case where you're returning the iOS response from multiple iOS observers on the JS-triggered event. How you'd do that eloquently though, I'm not sure.

To accept the PR, I'd need the reverse, however, where iOS sends a message and receives data from the JS side in response as well.

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