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

[Bug]: BrazeNotificationService - Does not exist in the list of available frameworks #48

Closed alexanderathan closed 1 year ago

alexanderathan commented 1 year ago

Platform

iOS

Platform Version

iOS 14.0

Braze SDK Version

5.11.0

Xcode Version

14.2

Computer Processor

Intel

Repro Rate

100% of the time

Steps To Reproduce

Hello there!

We are following this guide for Rich Push Notifications integration in our app.

The BrazeKit is installed via CocoaPods. More specifically, with: pod 'BrazeKit', '5.11.0'

We are unable to find BrazeNotificationService in General -> Frameworks & Libraries after pressing "+" button to add the framework in PushNotificationsServiceExtension.

Unfortunately, we cannot use Swift Package Manager.

Expected Behavior

After installing BrazeKit via CocoaPods, we should be able to see the BrazeNotificationsService framework in the list of frameworks under "Frameworks & Libraries" section of a notification service extension.

Actual Incorrect Behavior

BrazeNotificationService framework is not in the list of available frameworks under "Frameworks & Libraries" section of a notification service extension.

Thank you in advance for your time.

Verbose Logs

No response

Additional Information

BrazeNotificationService No response

jerielng commented 1 year ago

Hi @alexanderathan, since you are integrating with CocoaPods, you'll have to add the BrazeNotificationService dependency to your notification service extension target in your Podfile.

Can you verify if adding the following to the root-level of your Podfile works:

target '<your-notification-extension-target>' do
  pod 'BrazeNotificationService'
end

If you happen to be using the use_frameworks! directive in your Podfile, you can try this:

target '<your-notification-extension-target>' do
  use_frameworks! :linkage => :static
  pod 'BrazeNotificationService'
end

For more context, this thread and this thread provide some additional background information.

alexanderathan commented 1 year ago

H @jerielng, I was adding the extension's target in the Podfile as you mentioned, but my directive was use_frameworks! instead of use_frameworks! :linkage => :static, resulting in a duplication error. This change seems to solve the issue.

Thank you very much!