Post not yet marked as solved
Apparently it's a known issue that SSLSetALPNProtocols isn't exported. Getting linker errors and seeing multiple people saying they have radars on this.
Post not yet marked as solved
Thanks. This is just a great learning experience trying to implement this. You mentioned the kCFStreamPropertySSLContext. When I call property(forKey:) on the Stream it wants an Stream.PropertyKey value passed in, and there's no corresponding key that would return the certificate. So I'm not sure how to get the SSL context from the Stream that I just opened.
Post not yet marked as solved
I'm not sure how that helps me. I see a couple packets being sent, but the end result is still that I don't know how to handle the SSL handshake in my code. Googling for it is basically a dead-end as I either see ios info about ATS, URLSession, or general errors in deployed software.
Thank you! That never even occurred to me to try.
Thanks. It ends up looking like so: let constructor: ((_ data: [UInt8]) throws -> AbstractFrame)
switch type {
case .continuation:
constructor = ContinuationFrame.init
case .data:
constructor = DataFrame.init
case .goAway:
constructor = GoAwayFrame.init
case .headers:
constructor = HeadersFrame.init
case .ping:
constructor = PingFrame.init
case .priority:
constructor = PriorityFrame.init
case .pushPromise:
constructor = PushPromiseFrame.init
case .rstStream:
constructor = RstStreamFrame.init
case .settings:
constructor = SettingsFrame.init
case .windowUpdate:
constructor = WindowUpdateFrame.init
}
Well, the header file declares it as Self.IndexDistance, and when I scroll up to the top of the collection protocol it hasassociatedtype IndexDistance = IntSo you can see why I'm so confused 🙂
Post not yet marked as solved
I don't have a public one. Please open a bug yourself as well. The more people that report it the better the odds it gets fixed.
Post not yet marked as solved
Thanks for the explanation, Quinn. Suggestions on what I should use instead then to make the connection to the APNS server?
Post not yet marked as solved
The more I look into this it seems like the below is all that's actually needed since anything being enabled in settings returns true.let center = UNUserNotificationCenter.current()
center.requestAuthorization(options: []) {
[weak center, weak self] granted, _ in
guard granted, let center = center, let `self` = self else { return }
center.delegate = self
DispatchQueue.main.async {
application.registerForRemoteNotifications()
}
}
Post not yet marked as solved
Old thread, I know, but to me this is the easiest way to handle notifications:extension Notification.Name {
static let ParticipantJoined = Notification.Name("Participant Joined")
func post(object: Any? = nil, userInfo: [AnyHashable : Any]? = nil) {
NotificationCenter.default.post(name: self, object: object, userInfo: userInfo)
}
@discardableResult
func onPost(object: Any? = nil, queue: OperationQueue? = nil, using: @escaping (Notification) -> Void) -> NSObjectProtocol {
return NotificationCenter.default.addObserver(forName: self, object: object, queue: queue, using: using)
}
}Now when you want to post a norification with no details, which is the most common usage, you just do:Notification.Name.ParticipantJoined.post()And to "catch" it you just do:Notification.Name.ParticipantJoined.onPost { [weak self] note in
guard let `self` = self else { return }
// Do your stuff here
}Having to get the NotificationCenter involved in your code is just redundant and harder to read, IMHO. I'm working with a Notification, not a NotificationCenter, so why not hide it away? 🙂
Post not yet marked as solved
It's on an ipad, so should be plenty of room. If I comment out like you said it just shows accept. If I change that first one from cancel to default then it shows fine. For some reason it just doesn't want to show with a style of cancel.
Post not yet marked as solved
It's acting like, because there's not an english version of Localizable.strings, that this is the default one it has to pick from.
Post not yet marked as solved
I just ran myself, on my phone, through the debugger. It's showing the spanish. I even printed out Locale.current.languageCode, which said "en". I'm very confused!