ios - 对讲机 : iOS App crashing on updating user only on iOS 10. 3.2

标签 ios swift intercom-ios

我们很少有 iOS 用户在 Intercom 上更新用户时应用程序崩溃。所有人都在使用 iOS 10.3.2。

这是我们在注册后在 Intercom 上更新用户的方式

registerIntercomUser(userNo: self.gbl.getUserNo())

_ = dispatch_after(1) {

updateIntercomUser(userObj: userObj!, userNo:self.gbl.getUserNo())

}

下面是我们在 crashlytics 上得到的日志

Crashed: com.apple.main-thread
0  Evolution                      0x100061b84 specialized     updateIntercomUser(userObj : User, userNo : Int) -> ()     (IntercomLogger.swift:1543)
1  Evolution                      0x1000d97e4 partial apply for      ViewController.(checkLogin() -> ()).(closure #1) (ViewController.swift)
2  Evolution                      0x100148b28 partial apply for  (dispatch_after(Double, queue : DispatchQueue, closure : () -> ()) -> () ->  ()?).(closure #2) (Util.swift)
3  libdispatch.dylib              0x190fce9a0 _dispatch_client_callout + 16
4  libdispatch.dylib              0x190fdb604 _dispatch_continuation_pop + 448
5  libdispatch.dylib              0x190fe7c1c _dispatch_source_latch_and_call + 204
6  libdispatch.dylib              0x190fd08a0 _dispatch_source_invoke + 804
7  libdispatch.dylib              0x190fd34a0 _dispatch_main_queue_callback_4CF + 668
8  CoreFoundation                 0x1920c50c8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
9  CoreFoundation                 0x1920c2ce4 __CFRunLoopRun + 1572
10 CoreFoundation                 0x191ff2da4 CFRunLoopRunSpecific +  424
11 GraphicsServices               0x193a5c074 GSEventRunModal + 100
12 UIKit                          0x1982ad058 UIApplicationMain + 208
13 Evolution                      0x10005ea28 main (IntercomLogger.swift:17)
14 libdyld.dylib                  0x19100159c start + 4

请帮忙找出问题

最佳答案

崩溃是由于在主线程上调用对讲机的 updateuser 方法。将所有调用放在后台线程上修复了崩溃。

关于ios - 对讲机 : iOS App crashing on updating user only on iOS 10. 3.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44907009/

相关文章:

iTunesConnect TestFlight 的 iOS 应用程序版本和内部版本号

ios - @2x 图像的低分辨率

ios - Swift - 没有 Storyboard,如何制作模式弹出窗口?

ios - 将对讲机集成到 Swift iOS 应用程序中

ios - 捕捉通知并做某事

ios - 取消选中 UITableview 中的单元格时,如何从数组中删除数据?

ios - iPhone 5 有 3 个麦克风。我可以改变我正在录制的那个吗?

ios - 使用 RxSwift 阻塞线程

ios - 如何通过 prepare for segue 将不同的 url 传递给下一个 VC?

ios - 快速对讲推送通知