3

can any one help me in catching the JS log message on xcode console, JS has to be run on web view (UIWebView).

1 Answer 1

2

to receive message from one webview use custom url scheme just like "log:yourlogmsg"

js code

window.location = "log:yourlogmsg";

use

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType

and return false;

Sign up to request clarification or add additional context in comments.

1 Comment

where to write this line, i mean in which class and method window.location = "log:yourlogmsg";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.