Closed lmiskovic closed 10 months ago
Looks like I've been missing this part
export(libs.kmpnotifier)
isStatic = true
Works after adding it
@mirzemehdi can you explain or point to the doc where it explains why you need to export + download via swiftPM even though you have added it via pod into your library
@anuragdalia export part is needed for calling library methods from Swift when needed. And the reason why you need download also via Swift PM or Cocopoads, when it is not added from Swift side, ios compilation fails. I am not sure what is main reason behind that though
Thanks. I have a use case for FIRanalytics. when i add analytics in the cocoapods section in the build.gradle.kts, i get duplicate class warnings. I understand they are coming because FirebaseCore is imported indirectly via SwiftPM as well as via your lib and my own cocoapods { pod("FirebaseMessaging") }
It's not related to your library for sure, but if (you know anything about it + can shed some light on it), it'd be super awesome.
@anuragdalia Unfortunately, I don't know full context so don't know the solution. But maybe you add FirebaseMessaging from both Swift PM and Cocopoads at the same time and this can cause the issue.
or you can check this out and test if it would help:
https://kotlinlang.org/docs/native-cocoapods-libraries.html#with-custom-cinterop-options
When you add cocoapods { pod("FirebaseMessaging") }
setting different packageName. I never tested this though
Thanks @mirzemehdi
Hey, I'm trying to set up KMPNotifier to be used in shared code. Here is the relevant code. Am I maybe missing something? Android is working properly but for iOS I'm getting following errors:
I've gone through all steps I believe. library is imported as api in shared source sets
I've added the required library in Swift PM
Here is all of the Swift code. Please note that I'm not an iOS developer