title: JavascriptInterface in Xamarin.Android is obsolete and cant invoke C# from Javascript
body: <p>few months ago I had a custom Xamarin.Android renderer for a webview based on the sample code in 
  <a href="https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-renderer/hybridwebview" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-renderer/hybridwebview</a></p>
  
  <p>Javascript code was perfectly invoking my C# code however recently after the latest updates, the WebView control is no longer able to invoke the C# action,
  (to be more precise, if I am targeting Android 9.0 (API level 28) or higher)
  using API level 27 still works fine</p>
  
  <p>after more investigation, I figured out that the compiler gives a warning on [JavascriptInterface] is being obsolete! 
  <a href="https://docs.microsoft.com/en-us/dotnet/api/android.webkit.javascriptinterface?view=xamarin-android-sdk-9" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/dotnet/api/android.webkit.javascriptinterface?view=xamarin-android-sdk-9</a>
  and they advised to use the (IJavascriptInterface) instead</p>
  
  <p>here is the code to be reviewed</p>
  
  <pre><code>[JavascriptInterface]
  [Export ("invokeAction")]
  public void InvokeAction (string data)
  {
      HybridWebViewRenderer hybridRenderer;
      if (hybridWebViewRenderer != null &amp;&amp; hybridWebViewRenderer.TryGetTarget (out hybridRenderer))
      {
          hybridRenderer.Element.InvokeAction (data);
      }
  }
  </code></pre>
  
  <p>Does anyone know how to implement this properly to fix that and get Javascript to invoke my C# code again.</p>