Integrate javascript module with native SDK

左心房为你撑大大i 提交于 2019-12-01 12:31:34

问题


I have a React Web Application running inside a WebView using Cordova.

I need to integrate the javascript context with a third party native SDK.

I have used JNI in the past that allowed communication from JAVA to C code. Is there something similar for Javascript to JAVA (Android) and to Objective-C / Swift (iOS)?

My understanding is that we cannot simply develop a Cordova plugin since the "JNI-like" communication has to be in plain Javascript. That's because the integration with the native SDK is done by a third party script that we inject in our Cordova App.

So now the QUESTION is: how can the developers of the 3rd party script invoke functions of a native SDK via javascript? I have seen this project called NativeScript. Would this work in a WebView?

来源:https://stackoverflow.com/questions/54097153/integrate-javascript-module-with-native-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!