braze-inc / braze-swift-sdk

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

[Feature]: Support both static & dynamic frameworks via Package managers #61

Closed shahzadmajeed closed 11 months ago

shahzadmajeed commented 1 year ago

What problem are you facing?

Hi.

Currently XCFrameworks include statically built products/libraries but sometime we have to rely on dynamic products/libraries i.e., when using same dependency in multiple targets. This is to avoid copying symbols from static binaries into multiple targets which results into duplicate symbols errors.

Could you please include both static & dynamic binaries so that developers have a choice?

Thank you

Workarounds

N/A

Ideal Solution

Mentioned in the problem above but ideally we should add both static and dynamic libraries in the XCFramework. To keep the backward compatibility you can keep existing products as is but add new ones with Dynamic appended i.e., BrazeKitDynamic.dylib etc.

Other Information

No response

hokstuff commented 1 year ago

Hi @shahzadmajeed,

If you download braze-swift-sdk-prebuilt.zip from the relevant release, this contains both dynamic and static xcframeworks. Let us know if this fulfills your use case!

Also note that in 5.14.0 there was an update the BrazeUI framework.

Thanks!

shahzadmajeed commented 1 year ago

I see. We were using them via. swift package and were not able to link against dynamic type. We want to be able to switch between static & dynamic based on how we are generating projects (with Tuist). Do you think it will be possible to make swift package flexible to cover both use cases? We don't want to copy frameworks to our repository directly to avoid repo size increase.

hokstuff commented 1 year ago

Thanks for describing your use case in detail. Currently, we just provide the functionality to choose between static and dynamic via the assets directly, and we only support static frameworks when importing via SPM or Cocoapods. We have filed this feature request internally and will be in touch if we have further updates - thank you!

lowip commented 11 months ago

Hi @shahzadmajeed,

With our 7.4.0 release, we've added two new repositories offering our libraries as either static or dynamic XCFrameworks. Please refer to this table in the README and to the 7.4.0 entry in the CHANGELOG.

Thanks,