# Example for WebView message handling on form completion on android

**URL:** <https://community.feathery.io/t/example-for-webview-message-handling-on-form-completion-on-android/94>\
**Category:** Support\
**Created:** [September 25, 2023, 6:11pm UTC](https://community.feathery.io/t/example-for-webview-message-handling-on-form-completion-on-android/94 "2023-09-25T18:11:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jenvassar](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jenvassar](https://community.feathery.io/u/jenvassar)\
**Post date:** [September 25, 2023, 6:11pm UTC](https://community.feathery.io/t/example-for-webview-message-handling-on-form-completion-on-android/94/1 "2023-09-25T18:11:35Z")

</div>

" When the form is completed, Feathery will send completion messages through Webkit and WebView message handlers that you can listen to. The message is `Form completed` , and the Webkit message handler name is `feathery` ."

Can you help me understand how this would work for android kotlin webview? (Currently we are using a javascript interface)

---

<div class="post-metadata">

**Author:** ![peter](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.feathery.io/peter/32/7_2.png) [@peter](https://community.feathery.io/u/peter)\
**Post date:** [September 25, 2023, 9:37pm UTC](https://community.feathery.io/t/example-for-webview-message-handling-on-form-completion-on-android/94/2 "2023-09-25T21:37:54Z")

</div>

Hi jen, thanks for flagging! We’ve just added support for native android webviews as well [https://docs.feathery.io/develop/react/api-guide/form/event-handlers/onformcomplete#android-webview](https://docs.feathery.io/develop/react/api-guide/form/event-handlers/onformcomplete#android-webview)

If you have your form embedded, please upgrade to version 2.0.114 or above

---

<div class="post-metadata">

**Author:** ![jenvassar](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jenvassar](https://community.feathery.io/u/jenvassar)\
**Post date:** [September 28, 2023, 4:26pm UTC](https://community.feathery.io/t/example-for-webview-message-handling-on-form-completion-on-android/94/3 "2023-09-28T16:26:28Z")

</div>

Thanks for the quick reply! I’m not seeing a message come through the javascript bridge and am wondering what I’m missing? This is what I’ve got:

Javascript interface:

> inner class JSBridge(){  
> @JavascriptInterface  
> fun onComplete(message:String){  
> Log.d(“Feathery”, “message: $message”)  
> }  
> }

And I’ve named it FeatheryInterface:

> webView.addJavascriptInterface(JSBridge(),“FeatheryInterface”)

And I’m using the url method:

> webView.loadUrl(“[Feathery Forms](https://bigcartel.feathery.io/to/VvJs8F?_id=b29c8055-4963-4ff7-973a-ff051319335e)”)

I am seeing this error message after clicking on the final form button which should trigger the onComplete (not sure if it’s related):

[INFO:CONSOLE(2)] “Uncaught (in promise) Error: Method not found”, source: [Feathery Forms](https://bigcartel.feathery.io/static/js/2.9cbd58f4.chunk.js)

---

<div class="post-metadata">

**Author:** ![peter](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.feathery.io/peter/32/7_2.png) [@peter](https://community.feathery.io/u/peter)\
**Post date:** [September 28, 2023, 6:11pm UTC](https://community.feathery.io/t/example-for-webview-message-handling-on-form-completion-on-android/94/4 "2023-09-28T18:11:35Z")

</div>

Hey Jen, we just added some logging to test and draft preview forms that will log mobile completion behavior. Would you mind testing again with your test or draft preview form and post the resulting completion logs here? Also the onComplete function shouldn’t take in a parameter

---

<div class="post-metadata">

**Author:** ![jenvassar](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jenvassar](https://community.feathery.io/u/jenvassar)\
**Post date:** [September 28, 2023, 10:16pm UTC](https://community.feathery.io/t/example-for-webview-message-handling-on-form-completion-on-android/94/5 "2023-09-28T22:16:39Z")

</div>

Ah, it was because I was expecting a parameter in the onComplete method - I see the onComplete now, along with these logs:

onConsoleMessage: Android Webview event sent  
[INFO:CONSOLE(2)] “Android Webview event sent”, source: [https://bigcartel.feathery.io/static/js/2.da45068e.chunk.js](https://bigcartel.feathery.io/static/js/2.da45068e.chunk.js) (2)

Thanks so much for helping me track this down!

---

<div class="post-metadata">

**Author:** ![peter](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.feathery.io/peter/32/7_2.png) [@peter](https://community.feathery.io/u/peter)\
**Post date:** [September 28, 2023, 10:24pm UTC](https://community.feathery.io/t/example-for-webview-message-handling-on-form-completion-on-android/94/6 "2023-09-28T22:24:05Z")

</div>

Great! Glad this was resolved
