You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when i tap on the GetNameList button handler is called and the response is sent to webview javascript bridge, but the function(response) is not triggered.Please help me to solve the issue.
The text was updated successfully, but these errors were encountered:
If you launch the ExampleApp that comes with the repo, you'll find example code that does exactly what you want and works. I suggest you start with that code and make changes to it.
Hi marcus,
i want the handler to be called only when the getNameListBttnTapped method is triggered following is the script
<script> var bridge function getNameListBttnTapped(){ alert('inside getNameListBttnTapped') bridge.callHandler('testObjcCallback', {'foo': 'bar'}, function(response) { log('JS got response', response) alert(response) }) } window.onerror = function(err) { log('window.onerror: ' + err) } document.addEventListener('WebViewJavascriptBridgeReady', onBridgeReady, false) function onBridgeReady(event) { bridge = event.bridge } </script>Here is the code, i have used for registering the handler.
[_bridge registerHandler:@"testObjcCallback" handler:^(id data, WVJBResponseCallback responseCallback) {
NSLog(@"testObjcCallback called: %@", data);
responseCallback(@"Response from testObjcCallback");
}];
when i tap on the GetNameList button handler is called and the response is sent to webview javascript bridge, but the function(response) is not triggered.Please help me to solve the issue.
The text was updated successfully, but these errors were encountered: