braze-inc / braze-swift-sdk

Braze SDK for the Apple ecosystem, including: iOS, macOS, iPadOS, visionOS, tvOS
https://www.braze.com
Other
50 stars 19 forks source link

[Feature]: Swift Concurrency / Sendable support for Braze #85

Closed 3a4oT closed 1 week ago

3a4oT commented 11 months ago

What problem are you facing?

Braze should conform to Sendable protocol and expose async functions for Swift consumers instead of Obj-C versions with completion handlers.

Braze.Notifications.categories - should be revamped since it's produces a warning if I add the following settings to the swift package:

            swiftSettings: [.unsafeFlags(["-Xfrontend",
                                          "-warn-concurrency",
                                          "-Xfrontend",
                                          "-enable-actor-data-race-checks"
                                         ])
                           ]

Please note that on Swift 6 there would be errors. Please prepare Braze API for Swift 6.

Workarounds

partially resolved by

@preconcurrency  import BrazeKit

Ideal Solution

No response

Other Information

No response

jerielng commented 11 months ago

Hey @3a4oT, thanks for raising this. We've filed a ticket internally to dive into this to determine the best solution for supporting Sendable in Swift 6 and will keep you updated on a solution.

Thank you!

twittemb commented 2 months ago

+1

nacho4d commented 4 weeks ago

In Xcode16, when Swift 6 is enabled then concurrency checks are done it causes compiler errors in a couple of places in braze sdk. I hope braze developers prioritize on this soon.

hokstuff commented 1 week ago

Hi @3a4oT @twittemb @nacho4d,

We are happy to announce that we've released Swift SDK version 11.0.0 with support for Swift 6 concurrency and Sendable. You can reference the Changelog entry with more details.

Thanks and let us know if you run into any issues!