"kCFStreamNetworkServiceTypeVoIP" is deprecated in iOS9
AsyncSocket与SocketRocket用来做后台获取数据的时候报如下警告:
kCFStreamNetworkServiceTypeVoIP - this service type is deprecated in favor of using PushKit for VoIP control
苹果在iOS9中已经废弃了kCFStreamNetworkServiceTypeVoIP
1 2 |
/* deprecated network service type: */ CFN_EXPORT const CFStringRef kCFStreamNetworkServiceTypeVoIP CF_DEPRECATED(10_7, 10_11, 4_0, 9_0, "use PushKit for VoIP control purposes"); // voice over IP control - this service type is deprecated in favor of using PushKit for VoIP control |
虽然不耽误使用,但是也得寻求新方法
警告得知道需要使用PushKit框架进行设置
1 2 3 4 5 6 7 8 |
#import <PushKit/PushKit.h> ....... kCFStreamNetworkServiceTypeVoIP 改为 PKPushTypeVoIP 就OK: _inputStream = CFReadStreamSetProperty(readStream, kCFStreamNetworkServiceType, PKPushTypeVoIP); _outputStream = CFWriteStreamSetProperty(writeStream, kCFStreamNetworkServiceType, PKPushTypeVoIP); |
转载请注明:天狐博客 » iOS开发之Socket "kCFStreamNetworkServiceTypeVoIP" is deprecated in iOS9