Closed a714857512 closed 4 years ago
Xcode12 、真机iOS14状态下崩溃在 dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ [[ECOCoreManager shared] sendPacketData:data type:type plugin:plugin toDevice:device]; });
//发送数据
- (void)plugin:(__kindof ECOBasePlugin )plugin willSendData:(id)data type:(ECOPacketDataType)type toDevice:(ECOChannelDeviceInfo )device { // NSLog(@"<<[ECOPluginsManager] %@ plugin sendData:%@", plugin.pluginName, data); //封装数据 if (!data) { return; } dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ [[ECOCoreManager shared] sendPacketData:data type:type plugin:plugin toDevice:device]; }); }
由于iOS14系统本地网络权限限制,需要在工程的Info.plist文件中添加NSLocalNetworkUsageDescription和NSBonjourServices配置。在Xcode中选中Info.plist文件,右键选择Open As Source Code,并添加如下内容
<key>NSLocalNetworkUsageDescription</key>
<string></string>
<key>NSBonjourServices</key>
<array>
<string>_ECHO._tcp</string>
</array>
也可更新到0.0.6的tag号来解决崩溃问题
Xcode12 、真机iOS14状态下崩溃在 dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ [[ECOCoreManager shared] sendPacketData:data type:type plugin:plugin toDevice:device]; });
//发送数据