SKLn-Rad / Xam.Plugin.Webview

Xamarin Plugin for a HybridWebView in PCL projects.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OnNavigationStarted is not working on Android

mohammedmsadiq opened this issue · comments

the OnNavigationStarted event is not firing on android but it works on iOS fine see code below;

WebView1.OnNavigationStarted += WebView1_OnNavigationStarted;

private void WebView1_OnNavigationStarted(object sender, Xam.Plugin.WebView.Abstractions.Delegates.DecisionHandlerDelegate e)
        {
            var localUrl = e.Uri;
            var pdfExtension = ".pdf";

            if (localUrl.EndsWith(pdfExtension))
            {
                PdfLoadingControl.IsRunning = true;
                e.Cancel = true;
                assetWebViewPageViewModel.loadPDf(localUrl);
                PdfViwer.IsVisible = true;
            }
        }

Any suggestions...