Is it possible to call a Javascript function that returns a value from native code? #3937
-
I'm working on writing tests across the bridge and I see that native code can trigger events that the JS can listen for. However, I'd like for the native code to get a return value back from the JS code. If this is not possible, is there a somewhat elegant way to achieve this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
From native you can inject JS into the web-view, which then is executed there.
I think it should then be possible to gather the data there and return them, such that the completion handler fires. Take into consideration that this is an async operation... And other way could be to provide something like a DataSink in your plugin API, such that you can gather the data and then send it to the DataSink...
Does that help anyhow? 🙃 |
Beta Was this translation helpful? Give feedback.
From native you can inject JS into the web-view, which then is executed there.
I think it should then be possible to gather the data there and return them, such that the completion handler fires. Take into consideration that this is an async operation...
And other way could be to provide something like a DataSink in your plugin API, such that you can gather the data and then send it to the DataSink...