wendux / DSBridge-IOS

:earth_asia: A modern cross-platform JavaScript bridge, through which you can invoke each other's functions synchronously or asynchronously between JavaScript and native.
1.95k stars 303 forks source link

swift集成DSBridge无法在注册的JsApi方法里实现 #122

Closed wushuang1026 closed 4 years ago

wushuang1026 commented 4 years ago

开启debug模式后,dsbridge弹出错误提示,提示内容为:Method loading is not invoked, since there is not a implementation for it,大意是方法未被调用,因为它没有实现,但是确实是注册了api,请问楼主这是什么原因呢,android端已经实现了,不知道为什么在swift这里无法实现

kevincwt commented 4 years ago

请问这个是怎么解决的,我也遇到这个问题了,多谢

wushuang1026 commented 4 years ago

如果别的地方没问题,大多都是因为本地JsApi的接收参数类型和javascript中返回的参数类型不一样导致的

------------------ 原始邮件 ------------------ 发件人: "kevincwt"<notifications@github.com>; 发送时间: 2020年6月30日(星期二) 下午3:42 收件人: "wendux/DSBridge-IOS"<DSBridge-IOS@noreply.github.com>; 抄送: " "<1120547238@qq.com>;"State change"<state_change@noreply.github.com>; 主题: Re: [wendux/DSBridge-IOS] swift集成DSBridge无法在注册的JsApi方法里实现 (#122)

请问这个是怎么解决的,我也遇到这个问题了,多谢

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

jianghui1 commented 2 years ago

swift方法必须设置参数。就算我们定义的方法不需要参数,swift实现的时候也需要设置。