Comments (9)
真机下的.a要重新编译真机用的 , 工程中自带的是模拟器的
from dsbridge-ios.
我用你的Demo异步调用的时候也会闪退,但是在模拟器上不会.我是直接把文件夹拖入项目里的,没有使用.a文件.
from dsbridge-ios.
貌似只有异步调用会闪退.
from dsbridge-ios.
具体是点击哪个按钮触发的?错误能定位吗?你真机和模拟器系统版本分别是多少?真机的机型是什么?
from dsbridge-ios.
@wendux 可以定位.不是按钮,就是所有异步操作都会闪退.我的Xcode和Iphone都是最新的系统版本.我用得WKWebView,就是项目中的DWKWebView.
- (void)webView:(WKWebView *)webView runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt
defaultText:(nullable NSString *)defaultText initiatedByFrame:(WKFrameInfo *)frame
completionHandler:(void (^)(NSString * _Nullable result))completionHandler
报错方法就是这个.因为你异步操作里compeleter没有返回值.
NSString *method= [prompt substringFromIndex:[prefix length]];
NSString *result =[JSBUtil call:method :defaultText JavascriptInterfaceObject:_JavascriptInterfaceObject jscontext:webView];
completionHandler(result);
执行这一句代码之后,所有的异步操作这里的result都是一个字典,然后这个completionHandler需要传入的就是字符串类型.搞不懂的就是模拟器为什么是正常的.但是在真机里报错的就是这个地方
from dsbridge-ios.
现在手头没有真机,看了一下代码,可能是在获取使用performSelector执行的返回值类型为void的selector的返回值时,模拟器和真机处理不一样,模拟器会返回nil, 而真机却不是,可以将 JsApiTest.m 里面两个异步api函数的返回值都改成NSString试试,可以的话告诉我一声哦。
from dsbridge-ios.
NSString *method= [prompt substringFromIndex:[prefix length]];
NSString *result =[JSBUtil call:method :defaultText JavascriptInterfaceObject:_JavascriptInterfaceObject jscontext:webView];
if (![result isKindOfClass:[NSString class]]) {completionHandler(@"");return;};
completionHandler(result);
我把代码改成这个样子了,暂时不会出现闪退.但是不知道会不会有其他的影响。
from dsbridge-ios.
此问题已修复
from dsbridge-ios.
@wendux OK.麻烦啦.我也是准备来close这个issue的
from dsbridge-ios.
Related Issues (20)
- 原生异步函数如何支持重载?
- 获取网络数据后给前端传值不显示
- 崩溃ret=action(JavascriptInterfaceObject,sel,arg); HOT 2
- 使用dsBridge.call("name", "msg") msg 内容超过一定长度会被截断问题
- 使用 UIWindowSceneDelegate 的情况下,会导致奔溃(crash)
- addJavascriptObject方法添加的函数异步执行问题。 HOT 1
- 我已经重新设计了新的交互库,10分钟就能完成接入,也许可以帮助你. HOT 1
- I have redesigned new libraries, It only takes ten minutes to complete . Maybe can help you.
- 通过dsbridge.call调用,iOS端接收到的信息不正确
- 请问 dsuiDelegate 与 requestMediaCapturePermissionFor 代理实现 HOT 2
- oc 调用 js 只能传数组么?
- [ios]When webview video on full screen, js call native dsbridge will exit the fullscreen
- 新版xcode namespace命名与系统关键字冲突了
- 求助 swift js 调原生,异步有传参和回调,点击报错[__NSCFString count] HOT 1
- completionHandler
- 高频调用时会丢包 HOT 1
- 加载网页资源loadrequest,添加javascript无法响应 HOT 5
- 你好,希望添加对 Swift packages 的支持
- Xcode 15 打包,dsbridge失效 HOT 1
- 老铁们,DSBridge-HarmonyOS 版本来了
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dsbridge-ios.