braze-swift-sdk icon indicating copy to clipboard operation
braze-swift-sdk copied to clipboard

[Feature]: Swift Concurrency / Sendable support for Braze

Open 3a4oT opened this issue 2 years ago • 2 comments
trafficstars

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

3a4oT avatar Oct 26 '23 18:10 3a4oT

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!

jerielng avatar Oct 26 '23 18:10 jerielng

+1

twittemb avatar Jul 18 '24 11:07 twittemb

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.

nacho4d avatar Sep 07 '24 20:09 nacho4d

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!

hokstuff avatar Sep 23 '24 20:09 hokstuff