Java Script Interface.
irBlaster object contains several methods, and js will invoke the specific method according to the data-attribute bound to the element.
But when I run this code with real android app, WebView yields error says “NPMethod called on non-NPObject wrapped JSObject”.
The error message looks quite hard to understand the meaning, so I spent quite time to diagnose the code.
After several try, I found the following code works fine, but original one doesn’t:
That is why the Jasmine tests passed successfully. But the
So the issue can be resolved as following code by invoking the method in a “reflection” flavor:
In previous code, I invoke the
call, and provids irBlaster as the context as
this. So the problem solved, the code runs smoothly without issue.