What technology does Cordova use to enable JavaScript to call Android or iOS native methods?Is that JSBridge #445
Replies: 1 comment
-
There isn't anything really called the "JSBridge" On iOS it's mostly WKUserContentController which handles webview -> native messages, then I believe native -> webview messages are handled via evaluating JS. iOS 14+ has a promise-based API where content controllers can reply back with a message asynchronously, but Cordova supports iOS 11+ so it doesn't use that API. On Android, it uses javascript interfaces, it allows you to bind a java method as a js function which is exposed in the JS environment, it supports some JS basic types and allows you to synchronously return basic JS types as well. See JavascriptInterface. |
Beta Was this translation helpful? Give feedback.
-
What technology does Cordova use to enable JavaScript to call Android or iOS native methods?Is that JSBridge
Beta Was this translation helpful? Give feedback.
All reactions