Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include SwiftMessages in App and Extension with Cocoapods #552

Open
christophli opened this issue Jun 13, 2024 · 3 comments
Open

Include SwiftMessages in App and Extension with Cocoapods #552

christophli opened this issue Jun 13, 2024 · 3 comments

Comments

@christophli
Copy link

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?

@wtmoose
Copy link
Member

wtmoose commented Jun 23, 2024

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.

@christophli
Copy link
Author

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

@wtmoose
Copy link
Member

wtmoose commented Aug 12, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants