使用 EasyJSWebView 以便在我的应用中与JS进行通信。
[self.BookReaderWeb addJavascriptInterfaces:roomHelper WithName:@"ReadingRoomHelper"];
使用此代码链接JSinterface
。
现在我需要调用一个名为initiateAddBookmarkCall()
function initiateAddBookmarkCall(){
var locus = reader.getPlace().getLocus();
ReadingRoomHelper.postReaderLocus(JSON.stringify(locus));
}
这将是这样的!我需要获取locus的值并从以下地址获得返回:
ReadingRoomHelper.postReaderLocus(JSON.stringify(locus));
有人可以帮助我实现这个目标。