Closed ksabariraj closed 8 years ago
Hi, I have downloaded and tested my latest release from git(Builded on Xcode7.3.1). But couldn't repeat your case.
Could you please offer more infos? For example. Is it always executing default callback on the Swift side or on the other side? Snapshots will be more helpful : ]
By the way, If you just call methods sending data between Swift and Javascript rather than call registered handlers, that will only trigger default handler since handler is used to deal with 'designated job' and for which you don't designate will be passed through default handler.
Thank you
Hi,
Thanks for the quick update.
I am using Version 7.2.1 (7C1002).
Please find the attachment.
Thanks.
Hi,
Thanks for your details.
I tried both end. but, still the callback is not firing.
I am receiving message and responseId in data, but, when check if let responseId = swvbMsg["responseId"] as? String {
it's failed.
Can you please guide on this?
Note: I tried all function in both javascript and swift. All function failed in the same condition mentioned above.
Thanks, Sabari.
Hi, Try on these steps to see if program will run to this statement below
return self.messageHandlers[handlerName]
Since calling this method SwiftWebViewBridge.callSwiftHandler("printReceivedParmas", data, null) from the Javascript will send a message carried these infos below. The handlerName, 'printReceivedParmas', is the name of handler registered on Swift side
{
callbackId = "cb_1_JS_1470057761845";
data = {
age = 6;
name = "\U5c0f\U660e";
school = GDUT;
};
handlerName = printReceivedParmas;
}
So when Swift run into handleMessagesFromJS method, it will check message sent from JS if it designate a handle to deal with it. If no handlerName or not existed, then return defaultHandler at the end.
A More quickier way, just set up a break point at this line and test if Xcode will break in there
Hi,
Thanks for the code.
when I'm trying to run your code always default callback is executing. Can you please help me on this?
Thanks.