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

[Bug]: BrazeUI not found when trying to import it on an Objective-C class #108

Closed joaosouza-traxretail closed 1 month ago

joaosouza-traxretail commented 9 months ago

Platform

iOS

Platform Version

17.2

Braze SDK Version

8.0.1

Xcode Version

15.2

Computer Processor

Intel

Repro Rate

100%

Steps To Reproduce

Example:

  1. Add Braze using SPM
  2. Create an Objective-C file and add @import BrazeKit; and @import BrazeUI;
  3. Try to build the project
  4. Xcode will show the following error: module 'BrazeUI' not found error

Expected Behavior

Import BrazeUI in a Objective-C file.

Actual Incorrect Behavior

Unable to use BrazeUI in a Objective-C file.

Verbose Logs

No response

Additional Information

No response

lowip commented 9 months ago

Hi @joaosouza-traxretail,

Thank you for opening this ticket. We've been able to reproduce that error in a Swift project that makes use of Objective-C classes (but not in Objective-C projects — see our ObjC examples).

We're tracking the issue internally and will update here once we finished our investigation and/or have a fix ready.

In the meantime, you can use one of our prebuilt repository to avoid the issue completely:

Best,

joaosouza-traxretail commented 9 months ago

Hi @lowip thanks for answering so fast! Doing some investigation it seems that the error is thrown only if I added it to the header (.h) file. The problem with that is that I'm unable to use a custom class (that is different from the AppDelegate) as a BrazeInAppMessageUIDelegate (because I can only use the declaration BrazeInAppMessageUIDelegate in the implementation (.m) file).

Screenshot 2024-02-21 at 16 58 38

hokstuff commented 1 month ago

Thanks for all the info. Given the age of this issue and the valid workarounds suggested above, I am closing this out.