inc
inc

Reputation: 205

UIWebView javascript interface

In Android I can add javascript interface and retrieve a parameters from a WebView in a such way: For example I have javascript:

function showAndroidToast(toast) {
  Android.showToast(toast);
}  

And adding this interface I can retrieve parameters:

webView.addJavascriptInterface(new WebAppInterface(this), "Android");

 @JavascriptInterface
 public void showToast(String toast) {
     Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();
 }

Is there any equivalent in iOS. I have a button that calls javascript. I need to get parameters on button click.

Upvotes: 1

Views: 2288

Answers (1)

Related Questions