New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix iOS 16 crash by kCFStreamNetworkServiceTypeVoIP #804
Conversation
…s deprecated, use PKPushTypeVoIP in PushKit.
@@ -8200,8 +8201,8 @@ - (BOOL)enableBackgroundingOnSocketWithCaveat:(BOOL)caveat | |||
|
|||
#pragma clang diagnostic push | |||
#pragma clang diagnostic ignored "-Wdeprecated-declarations" | |||
r1 = CFReadStreamSetProperty(readStream, kCFStreamNetworkServiceType, kCFStreamNetworkServiceTypeVoIP); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge conflict with https://github.com/robbiehanson/CocoaAsyncSocket/pull/802/files
@@ -8200,8 +8201,8 @@ - (BOOL)enableBackgroundingOnSocketWithCaveat:(BOOL)caveat | |||
|
|||
#pragma clang diagnostic push | |||
#pragma clang diagnostic ignored "-Wdeprecated-declarations" | |||
r1 = CFReadStreamSetProperty(readStream, kCFStreamNetworkServiceType, kCFStreamNetworkServiceTypeVoIP); | |||
r2 = CFWriteStreamSetProperty(writeStream, kCFStreamNetworkServiceType, kCFStreamNetworkServiceTypeVoIP); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge conflict with https://github.com/robbiehanson/CocoaAsyncSocket/pull/802/files
@funnel20 Please review the PR and merge into master. |
@amiraion Do we agree that If not, I would like to mention that the proposed solution of @seasonZhu of using Apple docu on const CFStringRef kCFStreamNetworkServiceTypeBackground; Apple docu on const PKPushType PKPushTypeVoIP; Where typedef NSString *PKPushType; This is |
This pull request has been marked as stale, it will be closed automatically if there is no further activity. |
Fix iOS 16 crash by deprecated API, kCFStreamNetworkServiceTypeVoIP is deprecated, use PKPushTypeVoIP in PushKit.
I see this PR 802, use kCFStreamNetworkServiceTypeBackground replace kCFStreamNetworkServiceTypeVoIP.
I fix the crash by use 802 code.
In my App, I user CocoaMQTT, and it depend CocoaAsyncSocket, my App crash when mqtt begin to connect:
So I read Foundation code what‘s wrong with
kCFStreamNetworkServiceTypeVoIP
:kCFStreamNetworkServiceTypeVoIP is deprecated, and issues 402 mention.
Then I use PKPushTypeVoIP replace kCFStreamNetworkServiceTypeVoIP.
Great, it’s OK now.