Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

xamarin.forms navigating event is not firing from custom webview #7154

Closed
anirugu opened this issue Aug 14, 2019 · 5 comments
Closed

xamarin.forms navigating event is not firing from custom webview #7154

anirugu opened this issue Aug 14, 2019 · 5 comments
Labels
a/webview s/unverified New report that has yet to be verified t/bug 🐛

Comments

@anirugu
Copy link

anirugu commented Aug 14, 2019

I have made a custom class derived from WebViewRenderer and when I am using it in xaml and set navigating and navigated event, it doesn't fire at all.

I have tried setting event from xaml and .xaml.cs code. both are not working.

Is there something I missing. I means I need to hook some event in my class's renderer in droid and ios project.

or some kind of property I need to set. What exactly I does it I call the API get the html and it's showing in webview. Is there some property I need to enable or set to make it work.

@anirugu anirugu added s/unverified New report that has yet to be verified t/bug 🐛 labels Aug 14, 2019
@pauldipietro pauldipietro added this to New in Triage Aug 14, 2019
@jcmanke
Copy link
Contributor

jcmanke commented Aug 14, 2019

I have a guess for Android at least. Are you setting a custom WebViewClient?

@anirugu
Copy link
Author

anirugu commented Aug 15, 2019

yes

Control.SetWebViewClient(new CustomWebViewClient(e.NewElement as CustomWebView));

@jcmanke
Copy link
Contributor

jcmanke commented Aug 15, 2019

I recommend you take a look at the changes made in #3780. Instead of directly setting the client, override GetWebViewClient(), and make your CustomWebViewClient subclass FormsWebViewClient.

For iOS it's harder because it's not as opened up (see #6340). Easiest solution is probably to copy and modify the private delegate classes from the source code.

@anirugu
Copy link
Author

anirugu commented Aug 16, 2019

@jcmanke

Thanks for help. I solved this by overriding the method provided in ios and android renderer.

@anirugu anirugu closed this as completed Aug 16, 2019
Triage automation moved this from New to Closed Aug 16, 2019
@samhouts samhouts removed this from Closed in Triage Sep 15, 2019
@Chidt12
Copy link

Chidt12 commented Apr 9, 2020

Can you post your solution ?

@jcmanke

Thanks for help. I solved this by overriding the method provided in ios and android rendere

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/webview s/unverified New report that has yet to be verified t/bug 🐛
Projects
None yet
Development

No branches or pull requests

4 participants