shripalsoni04 / nativescript-webview-interface

Plugin for bi-directional communication between webView and android/ios
MIT License
88 stars 35 forks source link

Cannot read property isLoaded. #55

Closed pollyolly closed 3 years ago

pollyolly commented 4 years ago

Platform: Nativescript Vue Version: 6.2.0 Plugin: nativescript-webview-interface (1.4.3)

Problem: Cannot read property isLoaded.

File: nativescript-webview-interface/index.android.js (line:50)

WebViewInterface.prototype._initWebView = function(src){ var _this = this; if(this.webView.isLoaded) { _this._setAndroidWebViewSettings(src); } else { var handlerRef = _this.webView.on('loaded', function(){ _this._setAndroidWebViewSettings(src); _this.webView.off('loaded', handlerRef); }); } };

pollyolly commented 4 years ago

I think this plugin is no longer supported the latest Nativescript and Android Runtime. Currently Im using it to this version. Android Runtime: 6.2.0 Nativescript Cli: 6.0.3 Deployed in: Android 9

ghost commented 3 years ago

I use it on Android 10 | {N} 7, and it works like a charm ,

just change the plug-in ( file: index.android.js ) a bit:

line 2 from const platformModule = require("platform"); to const platformModule = require("@nativescript/core");

and

line 78 from if (platformModule.device.sdkVersion >= 19) { to if (platformModule.Device.sdkVersion >= 19) {

shripalsoni04 commented 3 years ago

Should have been fixed in the latest version @1.4.4