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

[Help]: How to set BrazeKit.overrideResourceBundle #128

Closed devssun closed 6 months ago

devssun commented 6 months ago

Platform

iOS

Platform Version

iOS 17.2

Braze SDK Version

7.5.0

Xcode Version

Xcode 15.2

Computer Processor

Apple (M1)

Repro Rate

100%

Steps To Reproduce

Steps

  1. Run the app.

Expected Behavior

Braze can find resources

Actual Incorrect Behavior

[braze] Error: Unable to find resources bundle, cannot load localizations and acknowledgments

Verbose Logs

No response

Additional Information

I use 7.5.0 version and we use Tuist to generate our app project. I read this issue #44. I add this code so the error doesn't appear. I want to know that is it right to write this code. Am I need to write BrazeKit.overrideResourceBundle = BrazeKitResourcesResources.bundle ?

BrazeKit.overrideResourceBundle = BrazeUIResources.bundle  // <- I'm confused this line. 
BrazeUI.overrideResourceBundle = BrazeUIResources.bundle
hokstuff commented 6 months ago

Hi @devssun,

Since you are using Tuist, you will have to find where the relevant resource bundles are located and then call the code you provided with the locations of those resources (notes here and more info in the thread). Note that you will have to set the bundle locations prior to initializing Braze.

I recommend looking into Tuist's docs around where they put the bundle resources if you can't find them and see what existing solutions there are. If you continue to run into issues, you can contact support@braze.com with your project so we can better pinpoint where Tuist moves your bundle resources.

Thanks!

devssun commented 6 months ago

@hokstuff Thank you, I understand.