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 use WKWebViewJavascriptBridge call js method from iOS like this:
[self.bridge callHandler:@"notExistJsMethod" data:nil responseCallback:^(id responseData) {
//can not get any response here
}];
If sometimes the js method does not exist, i can not get any callback to know there is something wrong. If I can get feedback, I can do some default processing.
The text was updated successfully, but these errors were encountered:
had refactor the WebViewJavascriptBridge .
If you are in trouble.You can try this.
Download Address: https://github.com/housenkui/WebViewJavascriptBridge
More light and more simple to use. 10 mins will enough to completed your demand.
Search "console.log("WebViewJavascriptBridge: WARNING: no handler for message from ObjC:", message);" inside WebViewJavascriptBridge_JS.m and modify JS code like this:
if (!handler) {
console.log("WebViewJavascriptBridge: WARNING: no handler for message from ObjC:", message);
if (message.callbackId) {
var callbackResponseId = message.callbackId;
_doSend({ handlerName:"", responseId:callbackResponseId, responseData:{"error": "jsHandlerNotFound"} });
}
}
This change require you provide a responseCallback or you cannot receive error callback
When i use WKWebViewJavascriptBridge call js method from iOS like this:
If sometimes the js method does not exist, i can not get any callback to know there is something wrong. If I can get feedback, I can do some default processing.
The text was updated successfully, but these errors were encountered: