Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

I need your help for HybridWebView Custom Renderer --> get current url

$
0
0

Hello
I need your help.
In this code, how can I get to get the current url

using System;
using Android.Webkit;
using Java.Interop;
using static Java.Util.ResourceBundle;
using Android.App;

namespace smartShare.Droid{

public class JSBridge : Java.Lang.Object{
    readonly WeakReference<UniversalWebViewRenderer> hybridWebViewRenderer;

    public JSBridge(UniversalWebViewRenderer Universal_bridRenderer)
    {
        hybridWebViewRenderer =
    new WeakReference<UniversalWebViewRenderer(Universal_bridRenderer);
    }

    [JavascriptInterface]
    [Export("invokeAction")]
    public void InvokeAction(string data)
    {
    if (hybridWebViewRenderer != null &&
    hybridWebViewRenderer.TryGetTarget(out UniversalWebViewRenderer UniversalbridRenderer))
    {
            UniversalbridRenderer.Element.InvokeAction(data);
    }
    }
}

}
I would like to instantiate a new step when the url is end.html
I relied heavily on https://developer.xamarin.com/samples/xamarin-forms/CustomRenderers/HybridWebView/

THANKS
Helder


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>