SwiftKickMobile/SwiftMessages

Include SwiftMessages in App and Extension with Cocoapods

Closed this issue · 4 comments

I have troubles including the pod in my main app project and an extension at the same time. For my main app it always includes the "App" part and the "AppExtension" extension part in the search paths. This causes that no notification banners are shown because the SWIFTMESSAGES_APP_EXTENSIONS flag is set in the main app as well

This behaviour is reproducible in the iMessageDemo-Project.

Steps to reproduce:

Add
pod 'SwiftMessages/App', '~> 10.0.0'
to the target
iMessageDemo
and run pod install

You can see that in the file Pods-iMessageDemo.debug.xcconfig both App and AppExtension are included in the search paths.

Did anyone have the same problem and knows how to solve it?

I don't know off the top of my head, but I'll take a look if you can provide a sample project. Otherwise, I'd suggest posting this on StackOverflow.

Thank you so much.
I attached a sample project: iMessageDemo.zip

It is the iMessageDemo-Project from your repo where i added the pods for the app itself and the extension, a scheme to run the main app and a ViewController to trigger the notification.
I am using as presentationContext .automatic, so I changed this too. With setting it to .viewController(self) it would work (but maybe other parts won't, as the makro is still set for the main app)

This is my output in the search paths for the app
Wrong search paths

If you run the demo app, you will see that the notifications are not working. If you search for the makro in the pod you can see that it is set
makro

I apologize for taking so long to respond to this. I've been super busy and I forgot.

I did spent some time looking into it. However, I haven't used Cocoapods in a few years and I didn't find a quick fix. It's weird because app extensions have been supported since 2018 and nobody ever reported this problem.

Are you still looking for a solution?

Closing due to no response