集成JPush报警告must be used from main thread only

box_he
2017-09-21 05:38 3.5k 0

swift: runtime: UI API called from background thread: -[UIApplication registerForRemoteNotifications] must be used from main thread only
runtime: UI API called from background thread: -[UIApplication currentUserNotificationSettings] must be used from main thread only

按照网上说的添加
DispatchQueue.main.async {
JPUSHService.register(forRemoteNotificationConfig: jpushEntity, delegate: self)
}
会收不到推送消息
如果不添加就xcode 报警告
有大神指点怎么做么?

1个回答

热门排序
  • 1、这个警告说的什么必须在主线程

    2、你用的是哪一个产品?原生SDK?插件?版本号多少?

    3、哪里报的这个警告?

    4、跑一下我们的demo,根据demo来写,集成指南里面也说了如何进行注册