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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

请问swift的话端方法如何定义?

alicksnake22 opened this issue · comments

这是我的swift的定义

 func testSyn(arg:String) -> String {
       return String(format:"%@[sync call:%@]", "msg", "test")
 }

js调用
alert(this.ds_bridge.call("testSyn","testSyn"))

然后页面alert报错:“Method{"data":"testSyn"} is not invoked, since there is not a implementation for it”

xcode报错:“json解析失败:Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}”

我是vue搭配dsbridge,swift4,ios11

最后问一下,3.0是否不支持UIWebview,目前依赖于Vassonic提升加载速度,可是后者不支持wkwebview,3.0是否有再次支持UIWebview的可能?

已经解决,原来是原生是2.0,js端是3.0,导致不一样。js端改为2.0没问题了,能回答一下3.0往后回复支持UIWebview吗

commented

3.0中是专门废弃了UIWebview的,以后版本也不会支持,如果仍然需要使用UIWebview,请使用dsbridge2.0