nativescript webview接口事件回调应用程序出现问题-将纯nativescript 5.x项目迁移到nativescript 6

nativescript webview接口事件回调应用程序出现问题-将纯nativescript 5.x项目迁移到nativescript 6,webview,nativescript,migrate,Webview,Nativescript,Migrate,使用nativescript webview接口并将事件注册到webview。事件被激发到应用程序,并且工作正常。但在nativescript 6中,相同的代码不起作用 var webViewInterfaceModule = require('nativescript-webview-interface'); exports.onWebViewLoaded=函数(args){ //其中buildsource返回html字符串 webview.on(webViewModule.WebView.

使用nativescript webview接口并将事件注册到webview。事件被激发到应用程序,并且工作正常。但在nativescript 6中,相同的代码不起作用

var webViewInterfaceModule = require('nativescript-webview-interface');
exports.onWebViewLoaded=函数(args){

//其中buildsource返回html字符串

webview.on(webViewModule.WebView.loadFinishedEvent, (args) => {
    //do something specific to app
});
oWebViewInterface.on("watchInc", (data) => {
      console.log("event watchInc - want to do something app specific"); 
      //not receiving this event
});

oWebViewInterface.on("watchEnd", (data) => {
    console.log("event watchEnd - want to do something app specific");
    //not receiving this event
}, 200); // Timeout needed as loading event is fired when nothing ready...

}谢谢manoj。移动到nativescript webview ext插件,webview和javascript之间的通信工作正常。

谢谢manoj。移动到nativescript webview ext插件,webview和javascript之间的通信正常。

此库似乎未维护,无法迁移以支持您尝试使用的nativescript 6.x.xId?此库似乎未维护,无法迁移以支持nativescript 6.x.xId你想试试吗?
webview.on(webViewModule.WebView.loadFinishedEvent, (args) => {
    //do something specific to app
});
oWebViewInterface.on("watchInc", (data) => {
      console.log("event watchInc - want to do something app specific"); 
      //not receiving this event
});

oWebViewInterface.on("watchEnd", (data) => {
    console.log("event watchEnd - want to do something app specific");
    //not receiving this event
}, 200); // Timeout needed as loading event is fired when nothing ready...